Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.
Visualize quantum states on the Bloch Sphere and differentiate between coherent pure states and statistical mixed density matrices.
Grasp complex quantum concepts visually with zero prior physics or math knowledge!
North Pole (θ=0)
100% chance of measuring 0
Equator (θ=π/2)
50/50 odds, ϕ rotates phase
South Pole (θ=π)
100% chance of measuring 1
Fly the quantum airplane around Latitude (θ) and Longitude (ϕ).
✈️ Plane Location: Latitude θ = 90°, Longitude ϕ = 0°
State Vector: |ψ⟩ = cos(45°)|0⟩ + e^(i·0°)sin(45°)|1⟩
💡 Quantum Secret: Algorithms spin longitude phase ϕ around the globe to perform magic interference without changing raw probabilities until final readout!
Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 5.8
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| Polar angle (0 to π radians) | Latitude: is North Pole (), is South Pole (), is the Equator | |
| Azimuthal phase angle (0 to 2π radians) | Longitude: relative quantum phase rotating around the equator | |
| Amplitude of basis state | Probability of measuring 0: | |
| Amplitude of basis state | Probability of measuring 1: , carrying relative phase |
Evaluating a qubit on the Equator pointing along the +X axis (θ = π/2 = 90°, ϕ = 0°):
Result: The state lies precisely on the Equator at (+X), representing an equal 50/50 superposition state .
Controls the probability ratio between measuring 0 and 1.
Controls the quantum phase (critical for quantum interference).
Quantum gates rotate the vector around X, Y, or Z axes.
Problem: Calibrating physical microwave control pulses on IBM Quantum superconducting chips.
Solution: Quantum State Tomography measures X, Y, and Z projections to reconstruct the exact Bloch vector.
Interactive activity component
Parameterize an arbitrary qubit state using rotation angles theta and phi, and extract its 3D Bloch sphere vector.
For Google Colab or Jupyter notebooks, run this shell command to install the required dependencies:
!pip install qiskit numpy1 from qiskit import QuantumCircuit 2 from qiskit.quantum_info import Statevector 3 import numpy as np
from qiskit import QuantumCircuit → Qiskit circuit constructor
from qiskit.quantum_info import Statevector → Statevector representation
import numpy as np → Trigonometric and mathematical functions
1 # Define Bloch sphere spherical coordinates: theta (latitude), phi (longitude) 2 theta = np.pi / 3 # 60 degrees from north pole 3 phi = np.pi / 4 # 45 degrees azimuth 4 5 # Construct state using Qiskit U gate: U(theta, phi, lambda) 6 qc = QuantumCircuit(1) 7 qc.u(theta, phi, 0, 0) 8 sv = Statevector.from_instruction(qc) 9 alpha, beta = sv.data[0], sv.data[1] 10 print(f'State Amplitudes: alpha = {alpha:.4f}, beta = {beta:.4f}') 11 12 # Calculate 3D Bloch Vector (x, y, z) 13 x = 2 * np.real(np.conj(alpha) * beta) 14 y = 2 * np.imag(np.conj(alpha) * beta) 15 z = np.abs(alpha)**2 - np.abs(beta)**2 16 print(f'\nBloch Sphere Coordinates (x, y, z):') 17 print(f' x = {x:.4f} (expected: {np.sin(theta)*np.cos(phi):.4f})') 18 print(f' y = {y:.4f} (expected: {np.sin(theta)*np.sin(phi):.4f})') 19 print(f' z = {z:.4f} (expected: {np.cos(theta):.4f})') 20 print(f'Vector length: {np.sqrt(x**2 + y**2 + z**2):.4f} (Pure state on unit sphere surface)')
# Define Bloch sphere spherical coordinates: theta (latitude), phi (longitude)
Angles
theta = np.pi / 3 # 60 degrees from north pole
Polar angle
phi = np.pi / 4 # 45 degrees azimuth
Azimuthal angle
# Construct state using Qiskit U gate: U(theta, phi, lambda)
Gate application
qc = QuantumCircuit(1)
Single qubit
qc.u(theta, phi, 0, 0)
Apply U(theta, phi, 0) gate to |0>
sv = Statevector.from_instruction(qc)
Extract statevector
alpha, beta = sv.data[0], sv.data[1]
Unpack amplitudes
print(f'State Amplitudes: alpha = {alpha:.4f}, beta = {beta:.4f}')
Amplitudes
# Calculate 3D Bloch Vector (x, y, z)
Bloch coordinates
x = 2 * np.real(np.conj(alpha) * beta)
Bloch x coordinate
y = 2 * np.imag(np.conj(alpha) * beta)
Bloch y coordinate
z = np.abs(alpha)**2 - np.abs(beta)**2
Bloch z coordinate
print(f'\nBloch Sphere Coordinates (x, y, z):')
Header
print(f' x = {x:.4f} (expected: {np.sin(theta)*np.cos(phi):.4f})')
X coord
print(f' y = {y:.4f} (expected: {np.sin(theta)*np.sin(phi):.4f})')
Y coord
print(f' z = {z:.4f} (expected: {np.cos(theta):.4f})')
Z coord
print(f'Vector length: {np.sqrt(x**2 + y**2 + z**2):.4f} (Pure state on unit sphere surface)')
Check purity
Click "Copy for Colab", open Google Colab, paste into a single cell, and run.
1 # ========================================================= 2 # Mapping Quantum States to Bloch Sphere Coordinates in Qiskit 3 # Prepared for Google Colab (Run with Shift + Enter) 4 # ========================================================= 5 6 # Step 1: Install required packages 7 !pip install qiskit numpy 8 9 # Step 2: Import libraries 10 from qiskit import QuantumCircuit 11 from qiskit.quantum_info import Statevector 12 import numpy as np 13 14 # Step 3: Run Demonstration 15 # Define Bloch sphere spherical coordinates: theta (latitude), phi (longitude) 16 theta = np.pi / 3 # 60 degrees from north pole 17 phi = np.pi / 4 # 45 degrees azimuth 18 19 # Construct state using Qiskit U gate: U(theta, phi, lambda) 20 qc = QuantumCircuit(1) 21 qc.u(theta, phi, 0, 0) 22 sv = Statevector.from_instruction(qc) 23 alpha, beta = sv.data[0], sv.data[1] 24 print(f'State Amplitudes: alpha = {alpha:.4f}, beta = {beta:.4f}') 25 26 # Calculate 3D Bloch Vector (x, y, z) 27 x = 2 * np.real(np.conj(alpha) * beta) 28 y = 2 * np.imag(np.conj(alpha) * beta) 29 z = np.abs(alpha)**2 - np.abs(beta)**2 30 print(f'\nBloch Sphere Coordinates (x, y, z):') 31 print(f' x = {x:.4f} (expected: {np.sin(theta)*np.cos(phi):.4f})') 32 print(f' y = {y:.4f} (expected: {np.sin(theta)*np.sin(phi):.4f})') 33 print(f' z = {z:.4f} (expected: {np.cos(theta):.4f})') 34 print(f'Vector length: {np.sqrt(x**2 + y**2 + z**2):.4f} (Pure state on unit sphere surface)')
Set theta = pi/3 and phi = pi/4 on the unit sphere.
Use Qiskit U(theta, phi, 0) gate to position the qubit on the Bloch sphere.
Calculate Cartesian coordinates (x, y, z) and verify that vector length equals 1.
Theta = pi/3, Phi = pi/4 on 1-qubit circuit.
Amplitudes: alpha = 0.8660, beta = 0.3536 + 0.3536j Bloch Vector: x = 0.6124, y = 0.6124, z = 0.5000 Vector length: 1.0000
Every single-qubit pure state corresponds to a unique point on the surface of the 3D unit Bloch sphere, providing an intuitive geometric representation of quantum states.
Hadamard gates, quantum measurement, histogram analysis, and probability collapse.
Test your understanding with these questions. Remember, this is for learning, not examination!