The Simplest Way Of Working With The Qiskit Quantum Circuit
Plain use of indexes
by Frank ZickertSeptember 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 QiskitQuantumCircuit 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.
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 accessThe QuantumCircuit allows access to its qubits via 0-indexed positions.
The usual way to access a qubit is to .
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.
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 .