Meet |0⟩ and |1⟩
Read ket notation and prepare a basis state.
Intuition
The brackets in |0⟩ name a state; they are not a new arithmetic operation. Think of |0⟩ and |1⟩ as the two reference directions for a qubit.
With basis order |0⟩, |1⟩, the vector [0, 1] means zero amplitude for 0 and unit amplitude for 1. The X gate exchanges these basis states, so applying it twice returns you to the start.
The mathematics
Look a little deeper
A vector and the negative of that entire vector represent the same pure physical state. A sign on just one component can change relative phase and later interference.
Use it
Explore two X gates, then remove one to prepare |1⟩ using exactly one gate.
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) 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.