Qubits and Quantum States
This page introduces the mathematical foundation of qubits and quantum states as implemented in the Quantum Simulator.
What is a Qubit?
A qubit (quantum bit) is the fundamental unit of quantum information. Unlike classical bits that can only be 0 or 1, qubits can exist in a superposition of both states simultaneously.
Mathematical Representation
A qubit state \(|\psi\rangle\) is represented as a linear combination of the computational basis states:
Where:
- \(\alpha, \beta \in \mathbb{C}\) are complex probability amplitudes
- \(|0\rangle, |1\rangle\) are the computational basis states
- The normalization condition requires: \(|\alpha|^2 + |\beta|^2 = 1\)
Computational Basis States
The two computational basis states are:
Any qubit state can be written in vector form:
Bloch Sphere Representation
Any single qubit state can be represented on the Bloch sphere using angles \(\theta\) and \(\phi\):
Where:
- \(\theta \in [0, \pi]\) is the polar angle
- \(\phi \in [0, 2\pi)\) is the azimuthal angle
Important Points on the Bloch Sphere
- North pole: \(|0\rangle\) (computational basis state)
- South pole: \(|1\rangle\) (computational basis state)
- Equator: Superposition states like \(|+\rangle, |-\rangle\)
Multi-Qubit Systems
For \(n\) qubits, the state space has dimension \(2^n\). The state vector has \(2^n\) complex amplitudes.
Two-Qubit System
A general two-qubit state is:
In vector form:
Computational Basis for Two Qubits
State Properties
Normalization
All quantum states must be normalized:
Orthogonality
Computational basis states are orthonormal:
Where \(\delta_{ij}\) is the Kronecker delta.
Examples in the Simulator
Creating a Qubit in |0⟩ State
from quantum_simulator import QuantumSimulator
# Create single qubit in |0⟩ state
sim = QuantumSimulator(1)
print(sim.get_state_vector()) # [1.0, 0.0]
Two-Qubit System in |00⟩ State
# Create two qubits in |00⟩ state
sim = QuantumSimulator(2)
print(sim.get_state_vector()) # [1.0, 0.0, 0.0, 0.0]
The simulator stores quantum states as complex numpy arrays, where each element represents the probability amplitude for the corresponding computational basis state.