k›ketwise.
FUNDAMENTALS / 13 / CIRCUITS

Two qubits and CNOT

Use control and target correctly and read Qiskit bit ordering.

Intuition

Two qubits need four basis labels: 00, 01, 10, 11. CNOT flips the target when the control is 1. On a superposition it acts coherently on every basis component.

We write |q1 q0⟩ to match Qiskit. For CX(0,1), |01⟩ becomes |11⟩ and |11⟩ becomes |01⟩; |00⟩ and |10⟩ stay unchanged. Control and target must be different wires.

The mathematics

∣00⟩→H(q0)∣00⟩+∣01⟩2→CX(0,1)∣00⟩+∣11⟩2|00\rangle\xrightarrow{H(q0)}\frac{|00\rangle+|01\rangle}{\sqrt2}\xrightarrow{CX(0,1)}\frac{|00\rangle+|11\rangle}{\sqrt2}
Look a little deeper

The two-qubit space is a tensor product of two two-dimensional spaces. For product states, expand (a|0⟩+b|1⟩)⊗(c|0⟩+d|1⟩) to obtain four amplitudes. Not every four-component state factors this way.

Use it

Prepare the Bell state using H and CX in at most two gates. Select control q0 and target q1 for CX(0,1).

This exercise uses the same server-side state and circuit checks as its linked practice problem.

Build your circuit

Click a gate to append it, or drag it onto a wire. CX uses the selected control; SWAP uses it as the second operand. Basis order: |qₙ … q₀⟩.

q0q1

Returned logical circuit · before transpilation · q0 on top

0 / 32 gates · terminal measurement of all qubits

Connect to code

qc.h(0)
qc.cx(0, 1)

These operations go inside a circuit-building program. Practice problems provide a complete solve() template.

Solve the linked Qiskit problem →

Check your understanding

In |q1 q0⟩ notation, H on q0 takes |00⟩ to…

First complete the circuit exercise successfully.