Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.
Contrast deterministic bits and Boolean logic with coherent qubits, unitary operations, and probabilistic measurement.
Grasp complex quantum concepts visually with zero prior physics or math knowledge!
Page-by-Page Inspection
Opens page 1, then page 2... checking 1 million names sequentially.
Parallel Interference
Reads all 1,000,000 pages at once; cancels 999,999 wrong names in silence!
Find 1 specific phone number in an unsorted directory.
O(N/2)
Checks page 1, page 2, page 3... Takes hours to search 500,000 pages on average.
O(√N)
Reads all pages in superposition. Destructive wave interference cancels wrong names in just 1,000 steps! (500x faster).
Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 5.3
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| Unitary transformation matrix | A quantum logic gate or operation that rotates the quantum state vector | |
| Conjugate transpose (Hermitian adjoint) | The exact reverse or "Undo" button of the quantum gate | |
| Identity matrix | The unchanged base state (equivalent to multiplying by 1) | |
| Born rule probability of outcome i | The percentage likelihood of reading state i upon measurement | |
| Total probability normalization | All possibilities combined must always total exactly 100% (1.0) |
Applying a Quantum NOT Gate (Pauli-X) to state |ψ⟩ = [0.6, 0.8]^T:
Result: Operation is 100% reversible with zero information loss, and total probability remains exactly 1.00.
Stored as presence (1) or absence (0) of ~10,000 electrons in a capacitor.
Stored as microscopic quantum degrees of freedom (electron spin up/down, superconducting flux).
Classical uses non-reversible logic gates (NAND); quantum uses reversible unitary rotations.
Problem: Eavesdroppers tapping fiber-optic cables without detection.
Solution: By the No-Cloning Theorem, any hacker attempting to copy or intercept quantum keys alters the state, instantly exposing their presence.
Interactive activity component
Demonstrate that unlike irreversible classical gates (AND/OR), quantum gates are always reversible unitary matrices (U * U† = I).
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 Operator, Statevector 3 import numpy as np
from qiskit import QuantumCircuit → Import circuit constructor
from qiskit.quantum_info import Operator, Statevector → Extract matrix operators and states
import numpy as np → Matrix math
1 # 1. Demonstrate Reversibility of Hadamard: H * H = Identity 2 qc = QuantumCircuit(1) 3 qc.h(0) # Put into superposition 4 sv_super = Statevector.from_instruction(qc) 5 print('After 1st Hadamard (Superposition):', sv_super.data.round(4)) 6 qc.h(0) # Apply Hadamard again to reverse 7 sv_restored = Statevector.from_instruction(qc) 8 print('After 2nd Hadamard (Restored):', sv_restored.data.round(4)) 9 10 # 2. Prove Operator is Unitary: U * U_dagger = I 11 op_h = Operator(QuantumCircuit(1).h(0)) 12 u_matrix = op_h.data 13 identity_check = np.dot(u_matrix, u_matrix.conj().T) 14 print('\nHadamard Unitary Matrix:\n', u_matrix.round(3)) 15 print('\nU * U† (Identity Matrix):\n', identity_check.round(3)) 16 print('\nVerification: Quantum gates preserve total probability and have exact inverses.')
# 1. Demonstrate Reversibility of Hadamard: H * H = Identity
Hadamard reversibility
qc = QuantumCircuit(1)
Single qubit in |0>
qc.h(0) # Put into superposition
First H gate
sv_super = Statevector.from_instruction(qc)
Extract superposition
print('After 1st Hadamard (Superposition):', sv_super.data.round(4))
Amplitudes [0.7071, 0.7071]
qc.h(0) # Apply Hadamard again to reverse
Second H gate
sv_restored = Statevector.from_instruction(qc)
Extract restored state
print('After 2nd Hadamard (Restored):', sv_restored.data.round(4))
Exact [1.0, 0.0] restored
# 2. Prove Operator is Unitary: U * U_dagger = I
Unitary proof
op_h = Operator(QuantumCircuit(1).h(0))
Hadamard operator
u_matrix = op_h.data
Matrix elements
identity_check = np.dot(u_matrix, u_matrix.conj().T)
U * U^dagger
print('\nHadamard Unitary Matrix:\n', u_matrix.round(3))
Matrix
print('\nU * U† (Identity Matrix):\n', identity_check.round(3))
Identity check
print('\nVerification: Quantum gates preserve total probability and have exact inverses.')
Summary
Click "Copy for Colab", open Google Colab, paste into a single cell, and run.
1 # ========================================================= 2 # Proving Reversibility of Quantum Unitaries 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 Operator, Statevector 12 import numpy as np 13 14 # Step 3: Run Demonstration 15 # 1. Demonstrate Reversibility of Hadamard: H * H = Identity 16 qc = QuantumCircuit(1) 17 qc.h(0) # Put into superposition 18 sv_super = Statevector.from_instruction(qc) 19 print('After 1st Hadamard (Superposition):', sv_super.data.round(4)) 20 qc.h(0) # Apply Hadamard again to reverse 21 sv_restored = Statevector.from_instruction(qc) 22 print('After 2nd Hadamard (Restored):', sv_restored.data.round(4)) 23 24 # 2. Prove Operator is Unitary: U * U_dagger = I 25 op_h = Operator(QuantumCircuit(1).h(0)) 26 u_matrix = op_h.data 27 identity_check = np.dot(u_matrix, u_matrix.conj().T) 28 print('\nHadamard Unitary Matrix:\n', u_matrix.round(3)) 29 print('\nU * U† (Identity Matrix):\n', identity_check.round(3)) 30 print('\nVerification: Quantum gates preserve total probability and have exact inverses.')
Apply Hadamard gate to transform |0> into |+>.
Apply Hadamard gate again to reverse the state back to pure |0>.
Compute U * U† and verify that it equals the identity matrix, confirming zero information loss.
QuantumCircuit(1) with sequential H gates.
After 1st Hadamard: [0.7071, 0.7071] After 2nd Hadamard: [1.0, 0.0] U * U† = [[1, 0], [0, 1]]
Classical logic operations like AND/NAND lose information and dissipate heat (Landauer's Principle). Quantum circuits consist strictly of unitary transformations, meaning every quantum operation is mathematically reversible with zero fundamental entropy loss.
From Probability and Complex Numbers to Qubits, Interference, Entanglement, and Multi-Qubit Systems by Dr. Syed Muzamil Basha.
Test your understanding with these questions. Remember, this is for learning, not examination!