The X gate
Use a matrix to explain a bit flip.
Intuition
X swaps the two amplitudes. On the basis states it acts like classical NOT, but it also acts on every superposition.
X maps α|0⟩+β|1⟩ to β|0⟩+α|1⟩. On the Bloch sphere it is a half-turn around the x axis, up to global phase. It does not mean 'set the qubit to 1'.
The mathematics
Look a little deeper
Matrix-vector multiplication swaps the first and second entries. X is unitary: its conjugate transpose times itself is identity, so it preserves normalization.
Use it
Transform |0⟩ into |1⟩ using a single X.
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₀⟩.
Returned logical circuit · before transpilation · q0 on top
Connect to code
qc.x(0)
These operations go inside a circuit-building program. Practice problems provide a complete solve() template.
Check your understanding
First complete the circuit exercise successfully.