Quantum Sandbox logo

Quantum Sandbox

An Interactive Quantum Circuit Playground

All Lessons Sandbox
Part 1: Foundations 9 min read

Quantum Notation

Before you can read or write quantum computing, you need to understand its language. Quantum notation is precise, compact, and once decoded, remarkably intuitive. This lesson translates every symbol you will encounter.

The ket: writing a quantum state

The most fundamental piece of notation is the ket, written as |⟩ with a label inside. The vertical bar and angle bracket together form a container for a quantum state. Think of it like a labeled jar: the jar itself (|⟩) doesn't change, but whatever you write inside it (0, 1, ψ) tells you exactly which state is being held.

Ket states: click each card to reveal what it represents
|0⟩
Tap to reveal
The "zero" state. The qubit will always measure as 0. This is the starting state of most quantum circuits: the quantum equivalent of false or off.
|1⟩
Tap to reveal
The "one" state. The qubit will always measure as 1. The quantum equivalent of true or on.
|ψ⟩
Tap to reveal
A general qubit state: any combination of |0⟩ and |1⟩. The Greek letter ψ (psi) is the standard variable for "some quantum state I haven't specified yet."
|+⟩
Tap to reveal
The "plus" state: equal superposition of |0⟩ and |1⟩ with the same phase. Produced by applying a Hadamard gate (H) to |0⟩. 50% chance of measuring 0 or 1.
|-⟩
Tap to reveal
The "minus" state: equal superposition with opposite phase: |0⟩ minus |1⟩, divided by √2. Produced by applying H to |1⟩. Same probabilities as |+⟩, but a different phase that matters for interference.

The full state equation: α and β

A single qubit in any state can always be written as:

Think of α and β as a recipe's mixing ratio rather than a fixed amount: they tell you the proportion of "0-ness" and "1-ness" baked into the qubit, not two separate values sitting side by side. Change the ratio, and you change what comes out when you measure.

|ψ⟩ = α|0⟩ + β|1⟩
|ψ⟩
The qubit state
Read as "ket psi." This is the qubit's complete state. Everything you can know about it right now. It is not a hidden value; it is the actual physical situation.
α
Alpha: amplitude for |0⟩
A complex number (it has a real part and an imaginary part). It sets how much the qubit "points toward" |0⟩. The probability of measuring 0 is |α|²: the square of alpha's magnitude.
|0⟩
The zero basis state
One of the two "pure" states a qubit can collapse to when measured. α multiplies it. The larger the |α|, the more likely measuring returns 0.
β
Beta: amplitude for |1⟩
Another complex number, this time for the |1⟩ component. The probability of measuring 1 is |β|². One constraint always holds: |α|² + |β|² = 1: total probability must equal 100% (basic mathematical principle).
+
Superposition: both at once
The plus sign means the state is a genuine combination of both |0⟩ and |1⟩ simultaneously, not just one or the other. This is superposition, and the plus sign is its mathematical expression.
Amplitude explorer: adjust α and β, see the probabilities

Here we use magnitudes (0 to 1) for simplicity. In the full math, α and β are complex numbers, but probabilities always come from squaring the magnitude. Drag either slider: the other adjusts automatically so |α|² + |β|² always stays exactly 1, just as real quantum amplitudes must.

|α| (magnitude of alpha)
|β| (magnitude of beta)
P(measure 0) = |α|²
50%
P(measure 1) = |β|²
50%
|ψ⟩ = 0.707·|0⟩ + 0.707·|1⟩
|α|² + |β|² = 1.000 ✓. Valid quantum state

What α and β actually are

In the full theory, α and β are complex numbers. A complex number has two parts: a real part and an imaginary part (the imaginary part involves √−1, written as i). So α might be something like 1/√2 + 0·i (real only) or 0 + i/√2 (imaginary only) or a mix.

The probability of measuring 0 is |α|². The magnitude of a complex number a + bi is √(a² + b²). So the imaginary part contributes to the probability through this magnitude.

Why does the imaginary part matter if probabilities only depend on the magnitude? Because the phase, the direction in the complex plane, determines how two amplitudes interfere with each other. Two states can have identical probabilities but opposite phases, and when combined they cancel out. This is quantum interference, and it is the mechanism that makes quantum algorithms work. It's similar to two water waves of equal height meeting trough-to-crest: same "size," but they cancel each other out on arrival instead of adding up.

The Quantum Sandbox shows you α and β as decimal numbers in the state panel on the right. When there is a nonzero imaginary part, you will see it written as a + bi.

Multi-qubit notation

When you have two qubits, the state is written with both values together inside one ket. The four possible basis states for two qubits are:

It's like reading a two-digit odometer: each digit can independently be 0 or 1, and the ket just writes both digits side by side in one label. |10⟩ is the qubit-pair equivalent of "first wheel on 1, second wheel on 0."

A general two-qubit state is written: α₀₀|00⟩ + α₀₁|01⟩ + α₁₀|10⟩ + α₁₁|11⟩, where all four amplitudes satisfy |α₀₀|² + |α₀₁|² + |α₁₀|² + |α₁₁|² = 1.

With n qubits, there are 2ⁿ basis states and 2ⁿ complex amplitudes. This is why quantum simulation gets exponentially expensive on classical computers, and why real quantum hardware has an inherent advantage.

Reading the Sandbox's state panel

Now that you know the notation, the Sandbox's right panel makes complete sense:

See it live in the Sandbox
Watch α and β change as you apply gates
  1. Start in |0⟩. α = 1, β = 0, Bloch sphere at north pole.
  2. Click H. α = β = 1/√2 ≈ 0.707, both probability bars show 50%.
  3. Click Z. bars stay at 50%, but β flips sign. Phase change: invisible to measurement.
  4. Switch to |+⟩ and apply S. The imaginary part of β appears in the state formula.
Key takeaway

|ψ⟩ = α|0⟩ + β|1⟩ is the universal description of a single qubit. α and β are complex amplitudes. Their magnitudes squared give the measurement probabilities, and they always sum to 1. The imaginary parts carry phase information that is invisible to single measurements but determines how quantum states interfere.

Knowledge check · Question 1 of 4

What does the ket notation |⟩ represent?

The vertical bar and angle bracket form a container (like a labeled jar) for whatever state is written inside, e.g. |0⟩, |1⟩, or |ψ⟩. It is notation for naming a state, not a value or operation by itself.
Knowledge check · Question 2 of 4

A qubit is in state |ψ⟩ = α|0⟩ + β|1⟩ where |α|² = 0.75 and |β|² = 0.25. What is the probability of measuring 1?

The probability of measuring each basis state equals the square of the corresponding amplitude's magnitude. P(measure 1) = |β|² = 0.25, so there is a 25% chance. P(measure 0) = |α|² = 0.75 = 75%, and they correctly sum to 1.
Knowledge check · Question 3 of 4

For a two-qubit system, how many basis states and amplitudes are needed to describe a general state?

With n qubits there are 2ⁿ basis states. For n = 2, that's 2² = 4: |00⟩, |01⟩, |10⟩, |11⟩, each with its own complex amplitude, and the squared magnitudes of all four sum to 1.
Knowledge check · Question 4 of 4

In the Quantum Sandbox's state panel, what does the Bloch sphere arrow's direction encode?

The Bloch sphere arrow is a full geometric picture of the qubit's state. It captures both amplitudes and the phase between them, which is exactly the information that a single probability bar (showing only |α|² or |β|²) can't show.