k›ketwise.
FUNDAMENTALS / 03 / STATES

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

X∣0⟩=∣1⟩,X∣1⟩=∣0⟩,X2=IX|0\rangle=|1\rangle,\quad X|1\rangle=|0\rangle,\quad X^2=I
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₀⟩.

q0

Returned logical circuit · before transpilation · q0 on top

0 / 32 gates · terminal measurement of all qubits

Connect to code

qc.x(0)
qc.x(0)

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

Solve the linked Qiskit problem →

Check your understanding

What does X followed by X do to |0⟩?

First complete the circuit exercise successfully.