The Simplest Way Of Working With The Qiskit Quantum Circuit

Plain use of indexes

by Frank Zickert
September 19, 2025

There are multiple ways of interacting withQiskit is an open-source Python framework for programming and simulating quantum computers. It lets users create quantum circuits, run them on real quantum hardware or simulators, and analyze the results. Essentially, it bridges high-level quantum algorithms with low-level hardware execution.
Learn more about Qiskit
QuantumCircuit primitive. Due to its brevity, it is most common to specify the number of A qubit is the basic unit of quantum information, representing a superposition of 0 and 1 states.
Learn more about Quantum Bit
and classical bits directly when initializing the QuantumCircuit.

However, as the circuit grows in size, it becomes difficult to maintain an overview. Therefore, this method should only be used for very small circuits where any additional structure is unnecessary overhead.

Quantum Circuit

What's good for a quantum computer can't be bad for humans, can it?
5 min
Quantum circuits are more than just abstract math. They bridge theory and hardware by turning dense unitary matrices into structured recipes that real devices can execute. From the simplest Bell state to complex algorithms, circuits provide an essential layer of abstraction that makes quantum computation both understandable and practical.

? shows how you import QuantumCircuit

qiskit-quantum-circuit.py
1
from qiskit import QuantumCircuit
Listing 1 Import QuantumCircuit

Plain Use

Most tutorials use the simplest form of quantum circuits and specify the number of qubits directly as the during initialization of the QuantumCircuit as shown in ?.

qiskit-quantum-circuit.py
1
2
3
4
5
6
7
8
9
10
11
# specify number of qubits as first parameter
qc = QuantumCircuit(2)
 
# single-qubit operator
qc.h(0)
 
# broadcast to list
qc.x([0, 1])
 
# two-qubit operator
qc.cx(0, 1)
Listing 2 Index access
    The QuantumCircuit allows access to its qubits via 0-indexed positions.
  1. The usual way to access a qubit is to .
  2. Some A quantum gate is a basic operation that changes the state of one or more qubits, similar to how a logic gate operates on bits in classical computing. It uses unitary transformations, meaning it preserves the total probability (the state’s length in complex space). Quantum gates enable superposition and entanglement, allowing quantum computers to perform computations that classical ones cannot efficiently replicate.
    Learn more about Quantum Gate
    support a . By specifying a list of positions, the operator is applied to all qubits at these positions.
  3. Two-qubit gates take the positions of the respective qubits .

QuantumCircuits also carry classical bits as depicted in ?.

qiskit-quantum-circuit.py
1
2
3
4
5
# specify number of classical bits as second parameter
qc = QuantumCircuit(3, 2)
 
# write into c[1]
qc.measure(1, 1)
Listing 3 Classical bits in QuantumCircuits

The second parameter when initializing a QuantumCircuit specifies the number of . These take the measurements and are also .