Notes/Qubits and Superposition: Why 'Both 0 and 1 at Once' Is Wrong
Back to Notes

Qubits and Superposition: Why 'Both 0 and 1 at Once' Is Wrong

Classical bits vs qubits, the Bloch sphere, Dirac notation, and what superposition actually means: the real foundation of quantum computing.

2025-07-25AI-Synthesized from Personal NotesSource1900+ words of raw notesEnrichmentsCode blocks, GraphicsPipelineMulti-pass AI review · Score: 96/100
Share
Quantum ComputingQubitsSuperpositionBloch Sphere

Terminology

Term Definition
Bit The fundamental unit of classical information, either 0 or 1
Qubit The fundamental unit of quantum information, a two-level quantum system described by a state vector in a 2D complex vector space
Superposition A qubit state that is a linear combination of basis states, $\alpha|0\rangle + \beta|1\rangle$, where $|\alpha|^2 + |\beta|^2 = 1$
Dirac notation Bra-ket notation used in quantum mechanics: $|0\rangle$ (ket) represents a column vector, $\langle 0|$ (bra) represents its conjugate transpose
Bloch sphere A geometric representation of a single qubit's state as a point on the surface of a unit sphere, where the north pole is $|0\rangle$ and the south pole is $|1\rangle$
Amplitude The complex coefficients $\alpha$ and $\beta$ in a qubit state $\alpha|0\rangle + \beta|1\rangle$. Their squared magnitudes give measurement probabilities
Measurement The act of observing a qubit, which collapses its superposition into a definite classical outcome (0 or 1) with probabilities determined by the amplitudes
Basis states The computational basis $\{|0\rangle, |1\rangle\}$, the standard "reference directions" in qubit state space, analogous to unit vectors $\hat{x}$ and $\hat{y}$
Complex vector space A vector space where scalars are complex numbers ($a + bi$). Qubit states live in $\mathbb{C}^2$, a 2-dimensional complex vector space
Born rule The probability of measuring outcome $|0\rangle$ from state $\alpha|0\rangle + \beta|1\rangle$ is $|\alpha|^2$, and the probability of $|1\rangle$ is $|\beta|^2$

What & Why

A classical bit is either 0 or 1. A qubit is a quantum system that, before measurement, exists in a state described by two complex numbers. This is not "both 0 and 1 at the same time." That popular analogy is misleading. A qubit in superposition is in a single, definite quantum state that happens to have a nonzero probability of producing either outcome when measured.

Why does this matter for computing? Because quantum algorithms exploit superposition (and later, entanglement and interference) to process information in ways that have no classical analogue. Grover's search achieves $O(\sqrt{n})$ lookups. Shor's algorithm factors integers in polynomial time. These speedups are not magic: they come from carefully manipulating amplitudes so that correct answers interfere constructively and wrong answers interfere destructively.

This post builds the foundation. Before you can understand quantum gates, entanglement, or any quantum algorithm, you need a precise understanding of what a qubit actually is, how Dirac notation works, and what the Bloch sphere represents geometrically.

Key properties of qubits:

  • State space: a qubit lives in $\mathbb{C}^2$, a 2-dimensional complex vector space
  • Normalization: the state $\alpha|0\rangle + \beta|1\rangle$ must satisfy $|\alpha|^2 + |\beta|^2 = 1$
  • Measurement is destructive: observing a qubit collapses it to $|0\rangle$ or $|1\rangle$
  • No cloning: you cannot copy an unknown quantum state (the no-cloning theorem)

How It Works

Classical Bits vs Qubits

A classical bit has two possible states: 0 and 1. You can represent this as a switch that is either off or on. A qubit also has two basis states, $|0\rangle$ and $|1\rangle$, but its general state is a linear combination:

$|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$

where $\alpha, \beta \in \mathbb{C}$ and $|\alpha|^2 + |\beta|^2 = 1$.

The key difference: a classical bit IS 0 or 1. A qubit is described by a state vector that encodes the probabilities of each measurement outcome. Before measurement, the qubit is not "secretly" 0 or 1. It is in a genuine quantum state with no classical equivalent.

Classical Bit 0 or 1 Exactly one value at all times Qubit α|0⟩ + β|1⟩ State vector in C², collapses on measurement to |0⟩ or |1⟩

Dirac Notation Basics

Quantum computing uses Dirac (bra-ket) notation. The two basis states are written as column vectors:

$|0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$

A general qubit state is then:

$|\psi\rangle = \alpha|0\rangle + \beta|1\rangle = \begin{pmatrix} \alpha \\ \beta \end{pmatrix}$

The "bra" $\langle\psi|$ is the conjugate transpose: $\langle\psi| = (\alpha^*, \beta^*)$. The inner product $\langle\phi|\psi\rangle$ gives the overlap between two states. The normalization condition $\langle\psi|\psi\rangle = |\alpha|^2 + |\beta|^2 = 1$ ensures valid probabilities.

Some important states beyond the computational basis:

$|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle), \quad |-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$

These are the eigenstates of the Hadamard gate and form the "X-basis," an equally valid measurement basis.

Why "Both 0 and 1 at Once" Is Wrong

The popular description of superposition as "being 0 and 1 simultaneously" suggests a qubit is like a coin that is both heads and tails. This is wrong for a precise reason: a qubit in state $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ is not in two states at once. It is in one state, the $|+\rangle$ state, which is a perfectly definite quantum state with specific, predictable properties.

The confusion arises because we try to describe quantum states using classical language. A better analogy: think of a qubit as an arrow pointing in some direction on the Bloch sphere. The arrow has a single, definite direction. It is only when we force the arrow to "choose" north or south (measurement in the Z-basis) that we get a probabilistic classical outcome.

What superposition actually gives quantum computing:

  • Interference: amplitudes can add constructively or destructively, allowing algorithms to amplify correct answers
  • Parallelism in amplitude space: a quantum operation transforms all amplitudes simultaneously, but you only extract one measurement outcome
  • Not exponential parallelism: $n$ qubits do not "try all $2^n$ answers at once." The power comes from structured interference, not brute-force parallelism

The Bloch Sphere

Any single-qubit pure state can be written using two angles $\theta$ and $\phi$:

$|\psi\rangle = \cos\frac{\theta}{2}|0\rangle + e^{i\phi}\sin\frac{\theta}{2}|1\rangle$

This maps every qubit state to a unique point on the surface of a unit sphere. The north pole ($\theta = 0$) is $|0\rangle$, the south pole ($\theta = \pi$) is $|1\rangle$, and the equator contains equal superpositions like $|+\rangle$ and $|-\rangle$.

|0⟩ |1⟩ |+⟩ |-⟩ |ψ⟩ θ Bloch sphere: every pure qubit state is a point on the surface

The Bloch sphere is powerful because quantum gates correspond to rotations of this sphere. A Hadamard gate rotates the state 180 degrees around an axis halfway between X and Z. A Pauli-Z gate rotates 180 degrees around the Z-axis. This geometric picture makes it much easier to visualize what quantum operations do.

Measurement and the Born Rule

When you measure a qubit in state $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ in the computational basis:

  • You get outcome 0 with probability $|\alpha|^2$
  • You get outcome 1 with probability $|\beta|^2$
  • After measurement, the qubit collapses to whichever state was observed

This is the Born rule. It is the bridge between the quantum world (amplitudes) and the classical world (probabilities). Crucially, measurement is irreversible: the pre-measurement superposition is destroyed.

α|0⟩ + β|1⟩ superposition measure |0⟩ prob = |α|² |1⟩ prob = |β|² state collapses, superposition lost

Multiple Qubits and State Space Growth

A single qubit has a state in $\mathbb{C}^2$. Two qubits live in $\mathbb{C}^2 \otimes \mathbb{C}^2 = \mathbb{C}^4$, with basis states $|00\rangle, |01\rangle, |10\rangle, |11\rangle$. In general, $n$ qubits require $2^n$ complex amplitudes to describe their joint state:

$|\psi\rangle = \sum_{x=0}^{2^n - 1} \alpha_x |x\rangle, \quad \sum_{x=0}^{2^n - 1} |\alpha_x|^2 = 1$

This exponential growth in state space is what makes quantum computing potentially powerful, and also what makes simulating quantum systems on classical computers so hard. Storing the state of 50 qubits requires $2^{50} \approx 10^{15}$ complex numbers, roughly a petabyte of memory.

Complexity Analysis

Quantum computing introduces its own complexity classes. The key comparison with classical computing:

Operation Classical Quantum Notes
Represent $n$-qubit state $2^n$ complex numbers $n$ qubits (physical) Exponential classical memory vs linear quantum hardware
Apply single-qubit gate $O(2^n)$ (simulate) $O(1)$ (physical) Classical simulation multiplies $2^n \times 2^n$ matrix
Unstructured search $O(N)$ $O(\sqrt{N})$ Grover's algorithm (quadratic speedup)
Integer factoring $O(e^{n^{1/3}})$ (best known) $O(n^3)$ Shor's algorithm (exponential speedup)
Measure qubit N/A $O(1)$ Collapses state, yields one classical bit

State Space Scaling

The memory required to classically simulate $n$ qubits grows exponentially:

$\text{Memory}(n) = 2^n \times 16 \text{ bytes} \quad (\text{two 64-bit floats per complex amplitude})$
Qubits ($n$) Amplitudes ($2^n$) Classical Memory
10 1,024 16 KB
20 ~1 million 16 MB
30 ~1 billion 16 GB
40 ~1 trillion 16 TB
50 ~$10^{15}$ 16 PB

This is why 50+ qubits is considered the "quantum supremacy" threshold: classical supercomputers cannot store or manipulate the full state vector.

Implementation

Qubit State Representation

STRUCTURE QubitState:
    alpha: Complex    // amplitude for |0⟩
    beta: Complex     // amplitude for |1⟩

FUNCTION createQubit(alpha, beta):
    INPUT: alpha, beta are complex numbers
    OUTPUT: a valid QubitState

    norm ← sqrt(|alpha|² + |beta|²)
    IF norm = 0 THEN
        ERROR "Cannot create zero-norm state"
    END IF

    RETURN QubitState(alpha / norm, beta / norm)

Measurement Simulation

FUNCTION measure(qubit):
    INPUT: qubit is a QubitState with amplitudes alpha, beta
    OUTPUT: classical bit (0 or 1), updated qubit state

    prob_zero ← |qubit.alpha|²
    r ← RANDOM_UNIFORM(0, 1)

    IF r < prob_zero THEN
        qubit.alpha ← 1
        qubit.beta ← 0
        RETURN 0
    ELSE
        qubit.alpha ← 0
        qubit.beta ← 1
        RETURN 1
    END IF

Bloch Sphere Coordinates

FUNCTION blochCoordinates(qubit):
    INPUT: qubit is a QubitState (alpha, beta)
    OUTPUT: (theta, phi) angles on the Bloch sphere

    // Extract theta from the magnitudes
    theta ← 2 * arccos(|qubit.alpha|)

    // Extract phi from the relative phase
    IF |qubit.beta| > 0 THEN
        phi ← arg(qubit.beta) - arg(qubit.alpha)
    ELSE
        phi ← 0
    END IF

    RETURN (theta, phi)

Multi-Qubit State Vector

FUNCTION tensorProduct(stateA, stateB):
    INPUT: stateA has amplitudes [a0, a1], stateB has amplitudes [b0, b1]
    OUTPUT: 4-element amplitude vector for the joint state

    // |stateA⟩ ⊗ |stateB⟩
    result ← ARRAY of size 4
    result[0] ← a0 * b0    // amplitude for |00⟩
    result[1] ← a0 * b1    // amplitude for |01⟩
    result[2] ← a1 * b0    // amplitude for |10⟩
    result[3] ← a1 * b1    // amplitude for |11⟩

    RETURN result

Probability Distribution from State Vector

FUNCTION probabilities(stateVector):
    INPUT: stateVector is an array of 2^n complex amplitudes
    OUTPUT: array of 2^n real probabilities

    n ← LENGTH(stateVector)
    probs ← ARRAY of size n

    FOR i ← 0 TO n - 1 DO
        probs[i] ← |stateVector[i]|²
    END FOR

    // Verify normalization
    total ← SUM(probs)
    ASSERT |total - 1.0| < 1e-10

    RETURN probs

Real-World Applications

  • Quantum key distribution (QKD): BB84 protocol uses qubits in different bases ($|0\rangle/|1\rangle$ and $|+\rangle/|-\rangle$) to detect eavesdropping. Any measurement by an interceptor disturbs the superposition, revealing their presence
  • Quantum random number generation: measuring a qubit in the $|+\rangle$ state produces truly random bits, not pseudorandom. Commercial QRNGs from ID Quantique use this principle
  • Quantum sensing: superposition makes qubits extremely sensitive to magnetic fields, gravity, and temperature. Quantum magnetometers achieve sensitivity impossible with classical sensors
  • Drug discovery and molecular simulation: representing molecular electron orbitals naturally maps to qubit superpositions. Simulating a caffeine molecule classically requires $\sim 10^{48}$ amplitudes, but maps to ~160 qubits
  • Quantum machine learning: variational quantum circuits use parameterized superpositions as a feature space, with potential advantages for certain kernel methods and sampling tasks
  • Classical simulation research: understanding qubit state spaces drives advances in tensor network methods, matrix product states, and other classical techniques that approximate quantum behavior

Key Takeaways

  • A qubit is not "both 0 and 1 at once." It is a state vector $\alpha|0\rangle + \beta|1\rangle$ in a 2D complex vector space, with $|\alpha|^2 + |\beta|^2 = 1$
  • Measurement collapses superposition: you get outcome 0 with probability $|\alpha|^2$ and outcome 1 with probability $|\beta|^2$ (the Born rule)
  • The Bloch sphere maps every single-qubit pure state to a point on a unit sphere, making quantum gates visualizable as rotations
  • The power of quantum computing comes from interference (constructive and destructive amplitude manipulation), not from "trying all answers at once"
  • $n$ qubits require $2^n$ complex amplitudes to describe classically, which is why quantum systems become intractable to simulate beyond ~50 qubits