From Quantum Information to Quantum Data
What the Heck is a Qubit?
-
Quantum computing can sound like magic, but it’s really just math. The difference is in how we do the math. And at the center of it all is the humble qubit.
Not Just a Bit: Complex Numbers and Quantum States
In classical computing, a bit can only take the values 0 or 1. But a qubit is different: it is a vector in a two-dimensional complex space. This means it doesn't just take the value 0 or 1. Instead, it's a superposition of both, with complex amplitudes (numbers with a real and imaginary part) that encode the probability of measuring a 0 or a 1.
If that sounds like a lot of information for a single qubit to carry, that’s because it is. A classical system with bits can represent one of possible values at a time. But a quantum system with qubits can simultaneously represent a linear combination of all possibilities. Basically, we’re storing a complex number instead of a boolean. That means exponential storage capacity in the number of qubits, and it’s not because we are storing more values intrinsically, but because we are manipulating probability amplitudes in a vector space.
Let’s make this more concrete: the states |0> and |1> can be represented as the following column matrices:
|0> = \col([1,0 ]) |1> = \col([0,1])
Another important state in Quantum, |+> = 1 / sqrt(2) x |0> + 1 / sqrt(2) x |1>, is represented like this in the |0>, |1> basis:
|+> = \col(1/sqrt(2), 1/sqrt(2))
Where it gets interesting, is that this is also a valid quantum state for a qubit: |ψ⟩ = i / sqrt(2) x |0⟩ + (1 + i ) / 2 x |1⟩. Any |ψ⟩ = α|0⟩ + β|1⟩ state is valid, as long as |α|² + |β|² = 1 because |α|² encodes the probability for the qubit to be measure in the state |0> while |β|² is the probability to measure the qubit in the state |1>. We will discuss this in more detail in a subsequent section.
A Qubit is a Matrix Citizen
In quantum computing, we don’t operate directly on qubit values. Instead, we apply unitary matrices to qubit states. Think of each quantum operation as a rotation in a high-dimensional complex space. These matrices preserve information while transforming it in ways that are reversible (unlike most classical operations).
Example of transformation: the bit flip operation X (or Pauli-X matrix) swap the probabilities of the qubit being measured as |0⟩ and |1⟩.
X = \matrix(0,1,1,0)
We will discuss the other typical transformation (and the quantum gates that they are associated with) in a subsequent section.
To get a better grasp on the concept, imagine rotating a qubit's state vector on the surface of a sphere, which we call the Bloch sphere. Each quantum gate is like a little nudge in some direction. But what’s unique in the quantum world is that these nudges interfere, entangle and collapse based on very different rules from classical logic.
Understanding qubits means understanding that quantum computing is fundamentally about transforming vector spaces instead of flipping bits. In Quantum Computing, we’re not programming logic gates; we’re orchestrating wavefunctions. When people think about Quantum, they often assume it’s primarily about acceleration, but the reality is that the future of computation won’t just be faster: it’ll be weirder, more beautiful, and built on mathematics that doesn’t just predict the future, but describes and models it.
To Remember:
A qubit stores a superposition of states, represented not by simple real numbers, but by complex amplitudes.
-
To make this abstract math digestible, physicists came up with a helpful visual: the Bloch sphere.
It’s a unit sphere in 3D space that represents the state of a single qubit. Any pure state (with no entanglement or mixed noise) corresponds to a point on its surface.
But here’s the catch:
The Bloch sphere is a projection. It hides the fact that quantum states use complex amplitudes, not just real coordinates.
In the Bloch visualization, the standard basis states appear at the North and South poles, meaning that they are visually aligned on the Z-axis. But in reality, these states are orthogonal, mathematically as far apart as possible. It’s a bit counter-intuitive for AI engineers so it’s important to understand that this is simply a limitation of our 3D intuition. The Bloch sphere “flattens” the complex structure into something we can draw, but it comes at a cost: not everything can be faithfully represented.
Even so, the Bloch sphere remains the best way to visualize:
Superposition and interference (via points along the equator)
Phase (how the vector spins around the sphere)
Quantum gates as rotations
Let’s take a look.
Visualizing Qubits: Tools & Code
Here are a few great Bloch sphere visualizers:
Quirk – Interactive quantum circuit simulator with live Bloch visualization
IBM Quantum Composer – Includes 3D Bloch tools
QuTiP Bloch Sphere – For Python users
Code Snippet (Python + Qiskit):
from qiskit import QuantumCircuit
from qiskit.visualization import plot_bloch_vector
import numpy as np
# Define a qubit in superposition
qc = QuantumCircuit(1)
qc.h(0) # Apply Hadamard gate
# Extract Bloch vector manually (optional Qiskit tools can visualize)
bloch_vector = [1/np.sqrt(2), 0, 0] # Example for |+> state
plot_bloch_vector(bloch_vector)
Coming Next
We’ll explore entanglement, quantum gates, and measurement soon. For now, sit with this question:
If you can't copy a qubit (no-cloning theorem), and you can't observe it without collapsing its state... how do you do machine learning?
We’ll get there.
-
Quantum systems are strange. One of the strangest features? Just observing them—measuring—forces them to make a decision.
Before measurement, a qubit can be in a superposition: a linear combination of the basis states |0⟩ and |1⟩, |ψ⟩ = α|0⟩ + β|1⟩. But the moment we measure it, this fuzzy cloud of possibilities collapses into a single, definite outcome: either |0> or |1>. There's no half-state or “maybe” left—just a clean classical bit.
Let’s look at a simple example.
The Curious Case of the |+⟩ State
There's a quantum state called ∣+⟩|+\rangle∣+⟩, which is an equal-weight blend of |0⟩ and |1⟩. Mathematically, it's:
∣+⟩=12∣0⟩+12∣1⟩|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle∣+⟩=21∣0⟩+21∣1⟩
You don’t need to worry yet about how to create this state—we’ll explore that in the circuits section—but imagine you’ve got a qubit in this state. When you measure it, you’ll get:
|0⟩ with 50% probability
|1⟩ with 50% probability
This isn’t uncertainty from lack of knowledge: it’s true randomness rooted in the quantum fabric of reality. And once the result appears, the state is no longer ∣+⟩|+\rangle∣+⟩; it has collapsed to either ∣0⟩|0\rangle∣0⟩ or ∣1⟩|1\rangle∣1⟩.
Key point: measurement doesn't just reveal a value: it changes its actual state.
If you still have a hard time grasping what happens, here is a small simulation that you can try for yourself.
from qiskit import QuantumCircuit, Aer, executefrom qiskit.visualization import plot_histogram
import matplotlib.pyplot as plt# Create a quantum circuit for |+⟩ = H|0⟩
qc_plus = QuantumCircuit(1, 1)
qc_plus.h(0) # Hadamard gate to create |+⟩
qc_plus.measure(0, 0) # Measure qubit# Simulate
backend = Aer.get_backend('qasm_simulator')
result_plus = execute(qc_plus, backend, shots=1000).result()
counts_plus = result_plus.get_counts()When Qubits Are Entangled
Things get even weirder when qubits are entangled. Imagine two qubits that have been linked together through a quantum gate (if you don’t know about quantum circuits yet, don’t worry: we’ll dig in soon!). Once entangled, their outcomes become correlated, even if they're far away from each other!
Let’s say we prepare this entangled state:
∣Φ+⟩=12(∣00⟩+∣11⟩)|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)∣Φ+⟩=21(∣00⟩+∣11⟩)
This is called a Bell state, and it means that the two qubits are in a kind of shared limbo—neither one has a definite value until measured. But once you measure one of them, the other collapses instantly to match.
For example:
If you measure the first qubit and get ∣0⟩|0\rangle∣0⟩, the second instantly collapses to ∣0⟩|0\rangle∣0⟩.
If you get ∣1⟩|1\rangle∣1⟩, the second instantly becomes ∣1⟩|1\rangle∣1⟩.
It doesn’t matter how far apart the qubits are. This is nonlocality in action—something Einstein once called “spooky action at a distance.”
# Create a Bell state circuit: (|00⟩ + |11⟩)/√2
qc_bell = QuantumCircuit(2, 2)
qc_bell.h(0) # Put qubit 0 in superposition
qc_bell.cx(0, 1) # Entangle with qubit 1
qc_bell.measure([0, 1], [0, 1])# Simulate
result_bell = execute(qc_bell, backend, shots=1000).result()
counts_bell = result_bell.get_counts()# Plot results
fig, axs = plt.subplots(1, 2, figsize=(12, 5))
plot_histogram(counts_plus, ax=axs[0])
axs[0].set_title('Measurement of |+⟩ State')
plot_histogram(counts_bell, ax=axs[1])
axs[1].set_title('Measurement of Bell State')
plt.tight_layout()
plt.show()Why This Matters
Every quantum algorithm ends in measurement. No matter how exotic the computation, what we ultimately see is a pattern of classical bits. That’s why understanding collapse is so critical: it’s where the quantum world hands us back something we can use.
Later, we’ll break down how gates create superpositions and entanglement, and show how quantum circuits manipulate probability distributions rather than individual bits. For now, just remember:
In quantum computing, measurement is irreversible.
Once you collapse a qubit, there's no going back.