Hinglish mein | First Principles se | Bilkul Start se
Teri apni notebook — kuch bhi yaad nahin karna, sab yahan hai 📖
🌌 Shuruat: Quantum Computing Kyun Seekhein?
Ek chhoti si kahani se shuruat karte hain...
Sochiye ek lock hai jisme 1 crore crore combinations hain. Classical computer — jo aaj ke laptops aur phones hain — ek-ek combination try karega. Lakho saal lag sakte hain.
Quantum computer? Woh ek saath sab combinations try kar sakta hai. Seconds mein kaam hoga.
Yahi quantum computing ka jaadu hai. Aur ye "jaadu" pure science aur math pe based hai. Chalo samajhte hain!
Is course mein hum seekhenge:
Qubit kya hai aur classical bit se kaise alag hai
Quantum gates — quantum ka "remote control"
Superposition, Entanglement, Interference — quantum ke 3 superpowers
Quantum circuits kaise banate hain (Qiskit mein code bhi!)
Real quantum computers pe kaise chalate hain
Superdense Coding aur Quantum Teleportation
⚛️ Chapter 1: Classical vs Quantum — Kya Fark Hai?
Classical Bit — Binary Ki Duniya
Aaj ke har computer (laptop, phone, calculator) ka basic building block ek transistor hai. Transistor basically ek switch hai — ya ON hai ya OFF.
📝 Bit: Ek classical bit ya toh 0 hota hai ya 1. ON ya OFF. Haan ya Naa. Koi beech ki cheez nahi.
🪙 Analogy: Ek sikka (coin) table pe rakha hai — ya Heads hai ya Tails. Ek waqt mein ek hi side upar hogi.
2 bits → 4 possibilities: 00, 01, 10, 11. Lekin ek waqt mein classical computer sirf ek state mein hota hai.
Qubit — Superposition Ki Duniya
🔥 Qubit ki khasiyat: Ek qubit ek saath 0 bhi ho sakta hai aur1 bhi! Jab tak hum use measure (dekho) na karein. Ise superposition kehte hain.
🪙 Analogy: Coin ko hawa mein uchhalo — ghoom raha hai, tab woh Heads bhi hai aur Tails bhi hai ek saath. Jab haath se pakad lete ho — tabhi decide hota hai kya aayega. Measure karna = coin pakadna hai!
Classical bit: ek waqt mein sirf ek. Qubit: dono ek saath (jab tak measure na karo)!
Quantum Computing Itna Powerful Kyun?
3 qubits simultaneously 2³ = 8 states explore kar sakte hain. n qubits → 2ⁿ states!
Qubits (n)
Simultaneous States (2ⁿ)
Kya matlab?
1
2
2 states ek saath
10
1,024
Hazaar states ek saath!
50
~10¹⁵ (1 Quadrillion)
Classical computer ki limit!
300
10⁹⁰
Universe mein atoms se bhi zyada!
💡 Quantum computer sab kuch "simultaneously" explore karta hai — lekin smart algorithms chahiye jo sahi answer ko amplify (bada) karein aur galat answers ko cancel karein. Yahi quantum algorithms ka kaam hai!
Qubit Physically Kya Hota Hai?
🌡️ Superconducting Qubit (IBM, Google)
Kya hai: Ek tiny electronic circuit jo superconductor se bana hai. Temperature: -273.14°C (0.015 Kelvin) — outer space se 100x thanda! Kyun itna thanda: Room temperature pe thermal vibrations qubit disturb kar dete. Itna thanda karo ki sab vibrations freeze ho jayein. |0⟩ aur |1⟩: Circuit ka low energy state = |0⟩, high energy state = |1⟩.
⚡ Trapped Ion Qubit (IonQ, Quantinuum)
Kya hai: Real atoms (Ytterbium Ya+) jo electromagnetic fields se trap hote hain. |0⟩ aur |1⟩: Atom ke do energy levels. Advantage: Coherence time minutes tak — superconducting se 1000x longer! Disadvantage: Gate operations slower hain.
📐 Chapter 2: Math Ki Neenv — Quantum Ki Language
Bhai, seedha keh deta hoon — Quantum Computing mein math hai. Complex numbers, matrices, vectors. Lekin darona mat — main tujhe ek ek cheez itne simple tarike se samjhaunga ki tu sochega "yaar yeh toh aasaan tha!" 😄
🔢 Complex Numbers — Quantum Ka Alphabet
Normal Numbers se Aage
Real numbers toh jaante ho: 1, 2, -5, 3.14, √2.
Problem: x² = -1 ka koi solution nahi tha real numbers mein.
Mathematicians ne ek naya symbol define kiya:
📝 i = √(-1) — imaginary unit. i² = -1.
Complex Number: z = a + bi
Jahan: a = real part, b = imaginary part, i = √(-1)
Example: z = 3 + 4i (real part = 3, imaginary part = 4)
i ki powers — ek cycle hain:
i⁰ = 1
i¹ = i
i² = -1 (kyunki i × i = √(-1) × √(-1) = -1)
i³ = -i (= i² × i = -1 × i)
i⁴ = 1 (= i² × i² = (-1)×(-1) = 1 ← wapas shuruat!)
i⁵ = i ... phir repeat
Complex numbers ek 2D plane pe hote hain. i se multiply = 90° counterclockwise rotate. Yahi quantum phase hai!
Polar Form — Phase Angle
Euler's formula (CRUCIAL): e^(iφ) = cos(φ) + i·sin(φ)
Important values:
e^(i·0) = 1 (phase = 0°)
e^(iπ/2) = i (phase = 90°)
e^(iπ) = -1 (phase = 180°) ← Euler's famous identity!
e^(i3π/2) = -i (phase = 270°)
General complex number in polar form:
z = r·e^(iφ)
r = |z| = modulus/magnitude = √(a² + b²)
φ = arg(z) = phase angle
Complex Conjugate aur Modulus — Probability Nikaalne Ka Tool
Complex conjugate: z* = (a + bi)* = a - bi (imaginary part ka sign flip)
Examples:
(3 + 4i)* = 3 - 4i
(2i)* = -2i
e^(iφ)* = e^(-iφ)
Modulus squared: |z|² = z × z* = (a + bi)(a - bi) = a² + b²
Examples:
|3 + 4i|² = 9 + 16 = 25
|i|² = 0 + 1 = 1
|e^(iφ)|² = 1 (ALWAYS! e^(iφ) ka magnitude hamesha 1 hota hai)
🔑 Quantum connection: Agar state ki amplitude α hai, toh probability = |α|². Yahi Born Rule ka core hai!
📊 Vectors aur Bra-Ket Notation
Quantum physicists ki ek special notation hai — Dirac Notation (Bra-Ket). Bahut elegant aur convenient!
📝 Hermitian Matrix: A† = A (conjugate transpose = itself)
Hermitian check on Z gate:
Z = [1 0]
[0 -1]
Z† = (Zᵀ)* = ([1 0])* = [1* 0* ] = [1 0] = Z ✓
([0 -1]) [0* (-1)*] [0 -1]
Z is Hermitian!
🔑 3 Magical Properties of Hermitian Matrices:
1. Eigenvalues are ALWAYS REAL
Physical measurements (position, momentum, energy, spin) hamesha real numbers hote hain. Isliye har observable quantum quantity ek Hermitian operator se represent hoti hai!
2. Eigenvectors orthogonal hote hain
Alag eigenvalues ke eigenvectors automatically perpendicular hote hain.
Eigenvalue equation: A|v⟩ = λ|v⟩
Matlab: Matrix A ko vector |v⟩ pe lagao — result SAME DIRECTION mein aata hai,
bas scale by factor λ.
λ = eigenvalue (ek number)
|v⟩ = eigenvector (ek vector)
Example — Pauli Z:
Z = [1 0]
[0 -1]
Z|0⟩ = [1 0] × [1] = [1] = 1×|0⟩ → eigenvalue = +1, eigenvector = |0⟩
[0 -1] [0] [0]
Z|1⟩ = [1 0] × [0] = [0] = -1×|1⟩ → eigenvalue = -1, eigenvector = |1⟩
[0 -1] [1] [-1]
Quantum measurement connection:
Jab Z measurement karte hain → outcomes are eigenvalues (+1 or -1)
State collapses to corresponding eigenvector (|0⟩ or |1⟩)!
Pauli Matrices — Quantum Ki Superstars
X = [0 1] Y = [0 -i] Z = [1 0]
[1 0] [i 0] [0 -1]
Sab teen Hermitian hain! (X† = X, Y† = Y, Z† = Z)
Sab teen Unitary hain! (X†X = I, Y†Y = I, Z†Z = I)
Sab teen self-inverse hain: X² = Y² = Z² = I
Cyclic relations:
XY = iZ YZ = iX ZX = iY
YX = -iZ ZY = -iX XZ = -iY
Sochiye qubit ki state badalte ho gate se. Baad mein measure karo.
Probabilities ka total HAMESHA 1 hona chahiye — kuch bhi "kho" nahi sakta.
Mathematically: Agar |α|² + |β|² = 1, toh gate U lagane ke baad bhi total = 1 hona chahiye.
Yeh SIRF tab possible hai jab U unitary ho! Unitary = "norm preserve" karti hai.
Isliye: Har quantum gate unitary matrix honi chahiye.
Proof that H is unitary:
H = (1/√2)[1 1]
[1 -1]
H† = (1/√2)[1 1] = H (H is also Hermitian!)
[1 -1]
H†H = H × H = (1/2)[1 1][1 1] = (1/2)[1+1 1-1] = (1/2)[2 0] = [1 0] = I ✓
[1 -1][1 -1] [1-1 1+1] [0 2] [0 1]
Proof complete: H is unitary!
🔑 Key distinction: Hermitian = describes WHAT we measure (observables) Unitary = describes HOW state EVOLVES (gates) Measurement = NOT unitary — irreversible! State collapses.
🎯 Chapter 3: Qubit — Complete Deep Dive
Ek Qubit Ki Complete Mathematical State
General qubit state:
|ψ⟩ = α|0⟩ + β|1⟩
Conditions:
- α, β are COMPLEX numbers (amplitudes)
- |α|² + |β|² = 1 (normalization — total probability = 1!)
- P(measuring |0⟩) = |α|²
- P(measuring |1⟩) = |β|²
Kisi bhi qubit state ko ek 3D sphere ke surface pe ek point se represent kar sakte hain — yeh sphere Bloch Sphere kehlati hai.
General state in Bloch sphere form:
|ψ⟩ = cos(θ/2)|0⟩ + e^(iφ)·sin(θ/2)|1⟩
θ (theta) = polar angle [0 to π] (north-south position)
φ (phi) = azimuthal angle [0 to 2π] (east-west position, rotation around Z axis)
Bloch Sphere — har qubit state ek point hai is sphere pe! Gates = sphere pe rotations
State
θ
φ
Location
Vector form
|0⟩
0
any
North Pole
[1, 0]ᵀ
|1⟩
π
any
South Pole
[0, 1]ᵀ
|+⟩
π/2
0
+X axis
(|0⟩+|1⟩)/√2
|−⟩
π/2
π
-X axis
(|0⟩-|1⟩)/√2
|+i⟩
π/2
π/2
+Y axis
(|0⟩+i|1⟩)/√2
|-i⟩
π/2
3π/2
-Y axis
(|0⟩-i|1⟩)/√2
💡 Gates = Rotations on Bloch Sphere!
X gate = π rotation around X-axis | Y gate = π around Y | Z gate = π around Z | H gate = swaps X and Z axes
🌊 Chapter 4: Phase Ka Jaadu — Global vs Relative Phase
Yeh chapter quantum mein sabse mind-bending concepts mein se ek hai. Dhyan se padho — ek baar samajh gaye toh quantum computing ka sabse important "engine" (interference) samajh aa jayega!
Global Phase — "Invisible" Phase
📝 Global Phase: Jab poori state ko ek phase factor e^(iθ) se multiply karo. |ψ'⟩ = e^(iθ)|ψ⟩ — yeh PHYSICALLY same state hai! Koi bhi measurement inka fark nahi bata sakta.
Proof — Step by Step
Original state: |ψ⟩ = α|0⟩ + β|1⟩
Modified state: |ψ'⟩ = e^(iθ)|ψ⟩ = e^(iθ)α|0⟩ + e^(iθ)β|1⟩
Measurement probability of |0⟩:
From |ψ⟩: P(0) = |⟨0|ψ⟩|² = |α|²
From |ψ'⟩: P(0) = |⟨0|ψ'⟩|² = |e^(iθ)α|² = |e^(iθ)|² × |α|² = 1 × |α|² = |α|²
Exactly the same! Because |e^(iθ)|² = 1 ALWAYS.
This holds for ANY gate, ANY measurement → global phase is UNDETECTABLE.
📌 Global Phase Examples
|0⟩ and -|0⟩ → SAME physical state (global phase = e^(iπ) = -1)
|0⟩ and i|0⟩ → SAME physical state (global phase = e^(iπ/2) = i)
(|0⟩+|1⟩)/√2 and -(|0⟩+|1⟩)/√2 → SAME state! (global phase = -1)
(3|0⟩+4i|1⟩)/5 and e^(iπ/4)×(3|0⟩+4i|1⟩)/5 → SAME state!
🔑 Practical consequence: Circuit compute karte waqt agar koi global phase (-1, i, e^(iθ)) bacha reh jaata hai — use IGNORE kar sakte hain! Labs mein iska bohot use hota hai.
Relative Phase — Iska Fark Padta Hai!
📝 Relative Phase: Alag components ka phase alag hona.
α|0⟩ + β|1⟩ mein relative phase = arg(β) - arg(α)
Yeh DETECTABLE hai — aur quantum computing ka engine hai!
📌 |+⟩ vs |−⟩ — Same probabilities, DIFFERENT states!
|+⟩ = (|0⟩ + |1⟩)/√2 relative phase of |1⟩ = 0°
|−⟩ = (|0⟩ - |1⟩)/√2 relative phase of |1⟩ = 180°
Z-basis (normal) measurement:
P(0) = P(1) = 50% for BOTH → Cannot distinguish!
X-basis measurement (apply H first, then measure):
H|+⟩ = |0⟩ → always get 0!
H|−⟩ = |1⟩ → always get 1!
So in X-basis they ARE different! Relative phase is detectable with the RIGHT measurement.
📌 Lab 3: S gate ka effect — HSH circuit
Start: |0⟩
Step 1 — Apply H:
|ψ₁⟩ = H|0⟩ = (|0⟩ + |1⟩)/√2 (|+⟩ state)
Step 2 — Apply S gate [S = [[1,0],[0,i]]]:
S leaves |0⟩ alone, adds i phase to |1⟩:
|ψ₂⟩ = S|ψ₁⟩ = (|0⟩ + i|1⟩)/√2
Relative phase now = 90° (from i = e^(iπ/2))
Step 3 — Apply H again:
H(|0⟩ + i|1⟩)/√2 = (H|0⟩ + i×H|1⟩)/√2
H|0⟩ = (|0⟩+|1⟩)/√2 H|1⟩ = (|0⟩-|1⟩)/√2
H(i|1⟩) = i×(|0⟩-|1⟩)/√2
Final state = [(|0⟩+|1⟩)/√2 + i(|0⟩-|1⟩)/√2] / √2
= [(1+i)|0⟩ + (1-i)|1⟩] / 2
P(0) = |(1+i)/2|² = (1² + 1²)/4 = 2/4 = 1/2 = 50% ✓
P(1) = |(1-i)/2|² = 2/4 = 1/2 = 50% ✓
Compare: Z instead of S in same circuit (HZH):
H|0⟩ = |+⟩, Z|+⟩ = |−⟩, H|−⟩ = |1⟩ → ALWAYS get 1! (100% not 50%)
→ HUGE difference! S gate aur Z gate ka effect bilkul alag hai even though both change relative phase.
🌊 Interference — Relative Phase Ka Jaadu
Yeh concept physics mein waves se aata hai. Light waves, water waves — jab do waves milti hain ya toh strengthen (constructive interference) karti hain ya cancel (destructive interference). Quantum mein amplitudes ke saath exactly yahi hota hai!
Start: |+⟩ = (|0⟩ + |1⟩)/√2
Apply H:
H|+⟩ = H(|0⟩ + |1⟩)/√2 = (H|0⟩ + H|1⟩)/√2
= ((|0⟩+|1⟩)/√2 + (|0⟩-|1⟩)/√2) / √2
= (2|0⟩/√2) / √2
= |0⟩
Let's understand WHAT HAPPENED:
- Amplitude for |0⟩ from H|0⟩: +1/√2
- Amplitude for |0⟩ from H|1⟩: +1/√2
- Total |0⟩ amplitude: +1/√2 + 1/√2 = 2/√2 = √2 → normalize → 1
→ CONSTRUCTIVE INTERFERENCE! P(0) = 1 = 100%
- Amplitude for |1⟩ from H|0⟩: +1/√2
- Amplitude for |1⟩ from H|1⟩: -1/√2
- Total |1⟩ amplitude: 1/√2 - 1/√2 = 0
→ DESTRUCTIVE INTERFERENCE! P(1) = 0 = 0%
H|+⟩ = |0⟩ ALWAYS! (Not random at all — interference made it deterministic!)
🔑 Why interference matters for Quantum Algorithms:
Grover's, Shor's — sab mein yahi principle:
1. Superposition mein dalo (explore all answers)
2. Wrong answers ko destructively interfere karao (cancel them)
3. Right answer ko constructively interfere karao (amplify it)
4. Measure karo → almost certainly sahi answer milega!
⚡ Chapter 5: Quantum Gates — State Badalne Ka Tarika
Classical circuit mein NOT gate, AND gate, OR gate hote hain.
Quantum circuit mein: X, Y, Z, H, S, T, CNOT, CZ, SWAP...
Har gate ek UNITARY matrix hai. Lagao qubit pe → state change hoti hai.
Chalo ek ek gate ekdam clearly samjhte hain!
X Gate — Quantum NOT
Matrix:
X = [0 1]
[1 0]
Actions (full calculation):
X|0⟩ = [0 1]×[1] = [0×1+1×0] = [0] = |1⟩ (0 → 1 !)
[1 0] [0] [1×1+0×0] [1]
X|1⟩ = [0 1]×[0] = [0×0+1×1] = [1] = |0⟩ (1 → 0 !)
[1 0] [1] [1×0+0×1] [0]
On general state:
X(α|0⟩ + β|1⟩) = α×X|0⟩ + β×X|1⟩ = α|1⟩ + β|0⟩ = β|0⟩ + α|1⟩
→ Amplitudes SWAP! α goes to |1⟩ slot, β goes to |0⟩ slot.
On superposition:
X|+⟩ = X(|0⟩+|1⟩)/√2 = (X|0⟩+X|1⟩)/√2 = (|1⟩+|0⟩)/√2 = |+⟩
→ |+⟩ is UNCHANGED! It's an eigenstate of X (eigenvalue +1)
X|−⟩ = X(|0⟩-|1⟩)/√2 = (|1⟩-|0⟩)/√2 = -(|0⟩-|1⟩)/√2 = -|−⟩
→ Gets global phase -1. Physically same as |−⟩. Eigenvalue = -1.
Properties: X² = I | Hermitian ✓ | Unitary ✓
Circuit Symbol
──|q⟩──[X]── (Bloch sphere: π rotation around X-axis)
Y Gate — Bit Flip + Phase Flip
Matrix:
Y = [0 -i]
[i 0]
Actions:
Y|0⟩ = [0 -i]×[1] = [0×1+(-i)×0] = [ 0] = i|1⟩ (adds i phase AND flips)
[i 0] [0] [i×1+ 0×0 ] [ i]
Y|1⟩ = [0 -i]×[0] = [0×0+(-i)×1] = [-i] = -i|0⟩ (adds -i phase AND flips)
[i 0] [1] [i×0+ 0×1 ] [ 0]
On general state:
Y(α|0⟩ + β|1⟩) = iα|1⟩ - iβ|0⟩ = -iβ|0⟩ + iα|1⟩
Y = iXZ (interesting decomposition)
Y² = I | Hermitian ✓ | Unitary ✓
Bloch sphere: π rotation around Y-axis
🔑 Key: Z gate Z-basis mein kuch NAHI karta (probabilities same). Lekin H ke baad (X-basis mein) effect clear hota hai. Isliye "phase gate" — sirf relative phase badalta hai.
H Gate — Hadamard — THE SUPERPOSITION CREATOR
Matrix:
H = (1/√2)×[1 1] = [1/√2 1/√2]
[1 -1] [1/√2 -1/√2]
Actions:
H|0⟩ = (1/√2)(|0⟩ + |1⟩) = |+⟩ (computational basis → superposition!)
H|1⟩ = (1/√2)(|0⟩ - |1⟩) = |−⟩ (1 → superposition with phase!)
Reverse (very important!):
H|+⟩ = |0⟩ (H undoes H!)
H|−⟩ = |1⟩
H² = I (two H gates = nothing! H is its own inverse!)
On general state:
H(α|0⟩ + β|1⟩) = α×H|0⟩ + β×H|1⟩
= α(|0⟩+|1⟩)/√2 + β(|0⟩-|1⟩)/√2
= ((α+β)/√2)|0⟩ + ((α-β)/√2)|1⟩
Hermitian ✓ (H† = H) AND Unitary ✓ (H²= I, so H⁻¹ = H = H†)
Hadamard: definite state → superposition. Every quantum algorithm isse shuru karta hai!
🧠 Try It!
Q: H|+⟩ ka calculation karo step by step
|+⟩ = (|0⟩+|1⟩)/√2
H|+⟩ = H × (|0⟩+|1⟩)/√2
= (H|0⟩ + H|1⟩)/√2
= (|+⟩ + |−⟩)/√2
= ((|0⟩+|1⟩)/√2 + (|0⟩-|1⟩)/√2) / √2
= (2|0⟩/√2) / √2 = |0⟩
H|+⟩ = |0⟩ ✓ (H is its own inverse!)
Q: HXH = ? (Famous result!)
HXH = ?
Method: Check action on basis states.
HXH|0⟩ = HX|+⟩ = H|+⟩ = |0⟩ (since X|+⟩=|+⟩)
Wait, let me reconsider: X|+⟩ = |+⟩
So HXH|0⟩ = H(X(H|0⟩)) = H(X|+⟩) = H|+⟩ = |0⟩
HXH|1⟩ = H(X(H|1⟩)) = H(X|−⟩) = H(-|−⟩) = -H|−⟩ = -|1⟩
So HXH = Z! (maps |0⟩→|0⟩, |1⟩→-|1⟩ = exactly what Z does!)
Similarly: HZH = X
Insight: H swaps X↔Z axes on the Bloch sphere!
This is why measuring in X-basis = apply H then measure in Z-basis.
S Gate — π/2 Phase Gate
Matrix:
S = [1 0]
[0 i]
Actions:
S|0⟩ = [1 0]×[1] = [1] = |0⟩ (unchanged)
[0 i] [0] [0]
S|1⟩ = [1 0]×[0] = [0] = i|1⟩ (adds i = e^(iπ/2) phase to |1⟩)
[0 i] [1] [i]
General state:
S(α|0⟩ + β|1⟩) = α|0⟩ + iβ|1⟩
S² = Z (two S = Z gate! Phase doubles: 90° × 2 = 180° = Z)
Bloch sphere: π/2 rotation around Z-axis
T Gate — π/4 Phase Gate
Matrix:
T = [1 0 ]
[0 e^(iπ/4) ]
e^(iπ/4) = cos(45°) + i×sin(45°) = (1+i)/√2 ≈ 0.707 + 0.707i
Actions:
T|0⟩ = |0⟩
T|1⟩ = e^(iπ/4)|1⟩ (adds 45° phase to |1⟩)
T² = S (phase doubles: 45° × 2 = 90° = S)
S² = Z (90° × 2 = 180° = Z)
T⁴ = Z T⁸ = I
The Tower: T (45°) → T²=S (90°) → S²=Z (180°) → Z²=I (360°)
Universal Gate Set: {H, T} + CNOT → can approximate ANY quantum operation!
T → S → Z → I: Phase doubles har step mein. Ek complete circle!
All Gates Summary
Gate
Matrix
|0⟩ pe
|1⟩ pe
Bloch Rotation
X
[[0,1],[1,0]]
|1⟩
|0⟩
π around X
Y
[[0,-i],[i,0]]
i|1⟩
-i|0⟩
π around Y
Z
[[1,0],[0,-1]]
|0⟩
-|1⟩
π around Z
H
(1/√2)[[1,1],[1,-1]]
|+⟩
|−⟩
π around (X+Z)/√2
S
[[1,0],[0,i]]
|0⟩
i|1⟩
π/2 around Z
T
[[1,0],[0,e^(iπ/4)]]
|0⟩
e^(iπ/4)|1⟩
π/4 around Z
🎲 Chapter 6: Born Rule — Measurement Ka Science
|ψ⟩ = α|0⟩ + β|1⟩ mein DONO 0 aur 1 hain. Jab measure karte hain — sirf ek result aata hai. Lekin kaunsa? Aur kyun?
1926 mein Max Born ne yeh rule diya. Iske liye 1954 mein Nobel Prize mila!
📝 Born Rule:
State |ψ⟩ = α|0⟩ + β|1⟩ ko measure karo:
• P(0) = |α|² = |⟨0|ψ⟩|²
• P(1) = |β|² = |⟨1|ψ⟩|²
• After measurement → state COLLAPSES to what you measured (irreversible!)
Example: |ψ⟩ = (3/5)|0⟩ + (4/5)|1⟩
Before measurement:
P(0) = |3/5|² = 9/25 = 36%
P(1) = |4/5|² = 16/25 = 64%
Say we get result '1' (with 64% probability):
After measurement → state = |1⟩ (collapsed!)
Now P(0) = 0%, P(1) = 100%
Measure again → ALWAYS get 1 (no more randomness)
What if we got '0'? → state = |0⟩, always 0 from now on.
Why Collapse? — The Deep Question
Quantum mechanics ka sabse controversial question! Alag interpretations hain:
🌍 Copenhagen: Measurement = wavefunction collapse. Pehle koi "real state" nahi thi.
🌌 Many-Worlds: State collapse nahi hoti. Universe branch ho jaata hai — ek mein 0, doosre mein 1.
📐 Relational QM: State collapse "relative to observer" hai.
Is course mein Copenhagen interpretation use karte hain (practical purposes ke liye). Philosophy baad mein! 😄
General Born Rule
State in any basis {|e₁⟩, |e₂⟩, ..., |eₙ⟩}:
|ψ⟩ = c₁|e₁⟩ + c₂|e₂⟩ + ... + cₙ|eₙ⟩
P(getting eₖ) = |⟨eₖ|ψ⟩|² = |cₖ|²
After getting eₖ → state collapses to |eₖ⟩
Normalization ensures: Σₖ |cₖ|² = 1 (probabilities sum to 1 ✓)
Expectation Value — Average of Many Measurements
⟨M⟩ = ⟨ψ|M|ψ⟩ = Σₖ mₖ × P(mₖ)
Example: ⟨Z⟩ for |+⟩:
Z eigenvalues: +1 (for |0⟩), -1 (for |1⟩)
|+⟩: P(0)=1/2, P(1)=1/2
⟨Z⟩ = (+1)×(1/2) + (-1)×(1/2) = 0
Average Z-measurement on |+⟩ = 0 (equal mix of +1 and -1)
💡 Why 1000 shots? Each measurement = ONE random result. 1000 shots → ~50/50 distribution confirmed statistically. Error ≈ 1/√shots = 1/√1000 ≈ 3%.
🔗 Chapter 7: Multi-Qubit Systems
Tensor Product (⊗) — Qubits Ko Milane Ka Tarika
Classical mein 2 bits: simply side-by-side likhte hain "01" ya "10".
Quantum mein 2 qubits combine karne ke liye tensor product (⊗) use karte hain. Yeh mathematical operation hai jo dono qubits ki full information capture karta hai.
General 2-qubit state:
|Ψ⟩ = α|00⟩ + β|01⟩ + γ|10⟩ + δ|11⟩ = [α, β, γ, δ]ᵀ
Normalization: |α|² + |β|² + |γ|² + |δ|² = 1
Probabilities: P(00)=|α|², P(01)=|β|², P(10)=|γ|², P(11)=|δ|²
n qubits → 2ⁿ amplitudes!
Classical n bits → 1 state (out of 2ⁿ possible)
Quantum n qubits → ALL 2ⁿ states simultaneously!
Entanglement — Quantum Ka Sabse Bada Jaadu
Einstein ne ise "spooky action at a distance" kaha.
Usne socha yeh koi measurement bug hai — lekin 2022 Nobel Prize ne experimentally confirm kiya: Entanglement real hai!
Ek qubit measure karo → doosra qubit INSTANTLY correlated result deta hai. Chahe woh Mars pe ho!
📝 Entanglement Test:
|Ψ⟩ = α|00⟩ + β|01⟩ + γ|10⟩ + δ|11⟩ ke liye:
Product state ↔ αδ = βγ
If αδ ≠ βγ → ENTANGLED!
|Φ+⟩ = (|00⟩+|11⟩)/√2
Measure first qubit:
50% → get 0 → state collapses to |00⟩ → second qubit is DEFINITELY 0
50% → get 1 → state collapses to |11⟩ → second qubit is DEFINITELY 1
Even if second qubit is on Mars:
Measure first qubit on Earth → second qubit INSTANTLY determined!
But: Cannot use for FTL communication (you can't control which result you get).
🔔 Bell States — Maximum Entanglement
4 Bell states (maximally entangled):
|Φ+⟩ = (|00⟩+|11⟩)/√2 "Phi plus"
|Φ-⟩ = (|00⟩-|11⟩)/√2 "Phi minus"
|Ψ+⟩ = (|01⟩+|10⟩)/√2 "Psi plus"
|Ψ-⟩ = (|01⟩-|10⟩)/√2 "Psi minus"
Properties:
- Sab mutually orthogonal (⟨Φ+|Φ-⟩ = 0, etc.)
- Yeh 4 states "Bell basis" banate hain
- Har ek maximally entangled
- Measurement correlations:
|Φ+⟩ → same result (00 or 11, each 50%)
|Ψ+⟩ → opposite result (01 or 10, each 50%)
Alice ko Bob ko ek message bhejna hai — 2 classical bits (00, 01, 10, ya 11).
Normal mein 2 physical objects bhejna padega.
Superdense coding mein: Sirf 1 qubit bhejo — Bob ko 2 bits milte hain!
Yeh entanglement ki wajah se possible hai.
Protocol Step by Step
Setup
Alice aur Bob pehle ek Bell state share karte hain:
|Φ+⟩ = (|00⟩+|11⟩)/√2
Alice ke paas qubit A, Bob ke paas qubit B.
💡 4 Bell states are mutually orthogonal → Bob can perfectly distinguish them → read 2 bits from 1 qubit. Pre-shared entanglement is the quantum resource!
🚀 Chapter 10: Quantum Teleportation — State Ko Teleport Karo!
Alice ke paas ek unknown state |ψ⟩ = α|0⟩ + β|1⟩ hai.
Woh ise Bob tak transfer karna chahti hai — lekin physically qubit nahi bhej sakti.
Solution: Entanglement + 2 classical bits! Note: Original state destroy ho jaata hai (No-Cloning Theorem).
No-Cloning Theorem
Suppose cloning machine hoti: U|ψ⟩|0⟩ = |ψ⟩|ψ⟩ for all |ψ⟩
Test with |ψ⟩=|0⟩: U|0⟩|0⟩ = |0⟩|0⟩ ...(i)
Test with |ψ⟩=|1⟩: U|1⟩|0⟩ = |1⟩|1⟩ ...(ii)
Test with |ψ⟩=|+⟩ = (|0⟩+|1⟩)/√2:
By linearity: U|+⟩|0⟩ = (U|0⟩|0⟩ + U|1⟩|0⟩)/√2 = (|00⟩+|11⟩)/√2 ...(from i,ii)
But if cloning: U|+⟩|0⟩ = |+⟩|+⟩ = (|0⟩+|1⟩)⊗(|0⟩+|1⟩)/2
= (|00⟩+|01⟩+|10⟩+|11⟩)/2 ...(different!)
CONTRADICTION! No cloning machine possible for arbitrary quantum states.
Teleportation moves the state — it doesn't copy it.
H|0⟩ = (|0⟩+|1⟩)/√2 H|1⟩ = (|0⟩-|1⟩)/√2
Applying H to qubit 0 in each term:
α|0⟩₀|00⟩₁₂/√2 → α(|0⟩+|1⟩)/√2 ⊗|00⟩/√2 → α(|000⟩+|100⟩)/2
... (similarly for all terms)
After collecting terms by Alice's 2-qubit state:
|Ψ⟩ = (1/2)[|00⟩(α|0⟩+β|1⟩) + |01⟩(α|1⟩+β|0⟩) + |10⟩(α|0⟩-β|1⟩) + |11⟩(α|1⟩-β|0⟩)]
= (1/2)[|00⟩|ψ⟩ + |01⟩X|ψ⟩ + |10⟩Z|ψ⟩ + |11⟩XZ|ψ⟩]
Step 3-4: Alice measures, sends result, Bob corrects
Alice measures qubits 0,1 → gets one of {00, 01, 10, 11}
Based on result:
Measures 00 → Bob has |ψ⟩ → Bob applies I → gets |ψ⟩ ✓
Measures 01 → Bob has X|ψ⟩ → Bob applies X → gets |ψ⟩ ✓
Measures 10 → Bob has Z|ψ⟩ → Bob applies Z → gets |ψ⟩ ✓
Measures 11 → Bob has XZ|ψ⟩ → Bob applies ZX → gets |ψ⟩ ✓
Alice sends 2 classical bits (e.g., via phone) to Bob.
Bob applies correction gate.
Bob now has |ψ⟩ = α|0⟩ + β|1⟩! 🎉
Quantum Teleportation Circuit
Alice: |ψ⟩──────────●──[H]──[M₀]──→ (classical bit to Bob)
|
Alice: |0⟩──[H]──●──⊕──────[M₁]──→ (classical bit to Bob)
shared|
Bob: |0⟩────────⊕──────────────[X if M₁=1]──[Z if M₀=1]──→ |ψ⟩!
Lab 8 — Actual Problems with Solutions
📌 Problem 1: Eve Listens
|ψ⟩ = (|0⟩ + 2i|1⟩)/√5, Alice measures m₀m₁ = 10
Formula: outcome 10 → Bob has Z|ψ⟩
Z|ψ⟩ = Z(|0⟩ + 2i|1⟩)/√5 = (Z|0⟩ + 2i×Z|1⟩)/√5 = (|0⟩ + 2i×(-|1⟩))/√5
= (|0⟩ - 2i|1⟩)/√5
Bob applies Z: Z(Z|ψ⟩) = Z²|ψ⟩ = |ψ⟩ ✓
Does Eve learn α, β?
Eve sees "10" (classical bits). This tells her WHICH correction Bob needs.
But it does NOT tell her α=1/√5 or β=2i/√5 (the actual quantum information).
Classical bits reveal the correction operation, not the unknown state!
📌 Problem 2: Eve Modifies the Message
|ψ⟩ = (3|0⟩+2i|1⟩)/√13, Alice gets result 11, Eve changes to 10.
For actual result 11: Bob has XZ|ψ⟩
Correct correction: Apply ZX → ZX(XZ|ψ⟩) = Z(X²)Z|ψ⟩ = Z²|ψ⟩ = |ψ⟩
But Eve changed 11→10, so Bob applies Z (correction for result 10):
Bob gets: Z×(XZ|ψ⟩) = ZXZ|ψ⟩
Compute ZXZ|ψ⟩:
Z|ψ⟩ = (3|0⟩-2i|1⟩)/√13
X(Z|ψ⟩) = (-2i|0⟩+3|1⟩)/√13
Z(X(Z|ψ⟩)) = (-2i|0⟩-3|1⟩)/√13 = -(2i|0⟩+3|1⟩)/√13
Global phase -1 → physically same as (2i|0⟩+3|1⟩)/√13
Fidelity with original |ψ⟩ = (3|0⟩+2i|1⟩)/√13:
F = |⟨ψ|corrupted⟩|² = |(3×2i + (-2i)×3)/(√13×√13)|² = |0/13|² = 0
FIDELITY = 0! Eve completely corrupted the state!
Bob gets wrong state, and cannot detect attack (can't compare with unknown original).
📌 Problem 3: Charlie Changes Bell State
Alice thinks they share |Φ+⟩, but Charlie gives |Ψ+⟩ instead.
For |Ψ+⟩ = (|01⟩+|10⟩)/√2, the teleportation formula is:
|Ψ⟩₀₁₂ = (1/2)[|00⟩(X|ψ⟩) + |01⟩(|ψ⟩) + |10⟩(XZ|ψ⟩) + |11⟩(Z|ψ⟩)]
For outcome 01: Bob has |ψ⟩ (no correction needed!)
But Bob (assuming |Φ+⟩) applies X for outcome 01:
Bob gets X|ψ⟩ → wrong!
Correction mapping comparison:
Result | For |Φ+⟩ | For |Ψ+⟩
00 | I | X
01 | X | I ← swapped!
10 | Z | XZ
11 | XZ | Z
If Bob knows it's |Ψ+⟩, he applies I for result 01 → gets |ψ⟩ ✓
Eve observes classical bits → still doesn't learn α, β (same as before)
Comparison
Superdense Coding
Quantum Teleportation
Goal
Send classical bits
Transfer quantum state
Transmitted
1 qubit
2 classical bits
Result
Bob reads 2 bits
Bob gets |ψ⟩
Entanglement
Required (pre-shared)
Required (pre-shared)
Original state
N/A
DESTROYED at Alice
Does Eve learn state?
N/A
NO — bits reveal correction, not state
💻 Chapter 11: Real Quantum Hardware — Asli Machines!
🌡️ Superconducting Qubits (IBM, Google)
What: Josephson junction — do superconductors ke beech thin insulator
Temp: ~15 millikelvin (outer space se 100x thanda!)
from qiskit import QuantumCircuit
qc = QuantumCircuit(3, 2)
# Create Bell pair (qubits 1 and 2)
qc.h(1)
qc.cx(1, 2)
# State to teleport: put qubit 0 in some state
qc.h(0) # Teleport |+⟩ state
qc.barrier()
# Teleportation protocol
qc.cx(0, 1) # CNOT: q0 controls q1
qc.h(0) # H on q0
qc.barrier()
# Measure q0 and q1 (Alice's measurement)
qc.measure(0, 0)
qc.measure(1, 1)
qc.barrier()
# Bob's corrections (classical control)
qc.x(2).c_if(qc.clbits[1], 1) # X if classical bit 1 = 1
qc.z(2).c_if(qc.clbits[0], 1) # Z if classical bit 0 = 1
# Now qubit 2 should have the original |+⟩ state!
Gate
Qiskit
What it does
X
qc.x(q)
Pauli X (NOT gate)
Y
qc.y(q)
Pauli Y
Z
qc.z(q)
Pauli Z (phase flip)
H
qc.h(q)
Hadamard
S
qc.s(q)
S gate (π/2 phase)
T
qc.t(q)
T gate (π/4 phase)
CNOT
qc.cx(c,t)
Controlled-NOT
CZ
qc.cz(q0,q1)
Controlled-Z
SWAP
qc.swap(q0,q1)
Swap two qubits
Measure
qc.measure(q,c)
Measure qubit
📝 Chapter 13: Practice Problems — Saare Actual Problems
Q14: Bonus Lab 7 — Can you create entanglement using only H, X, Z, T? (No CNOT)
NO! Single-qubit gates of form A⊗B:
(A⊗B)(|ψ₁⟩⊗|ψ₂⟩) = (A|ψ₁⟩)⊗(B|ψ₂⟩) — still product state!
Any sequence of single-qubit gates applied to product state → still product state.
Entanglement requires genuine 2-qubit interaction (CNOT, CZ, SWAP).
E: Phase Problems
🌊 Phase Practice
Q15: e^(iπ/3)|+⟩ aur |+⟩ — same physical state?
e^(iπ/3) is a GLOBAL phase (multiplying entire state).
|e^(iπ/3)|² = 1, so all probabilities unchanged.
YES — same physical state! ✓
Q16: (|0⟩+i|1⟩)/√2 aur (|0⟩-i|1⟩)/√2 — same?
Relative phases: arg(i) = π/2 vs arg(-i) = -π/2 → DIFFERENT relative phases.
No global phase relates them (would require e^(iθ)×i = -i → e^(iθ) = -1 AND e^(iθ)×1 = 1 → contradiction).
NO — different states! |+i⟩ vs |-i⟩ (+Y and -Y eigenstates on Bloch sphere).
Step by step:
|00⟩
→ H⊗I: (|0⟩+|1⟩)/√2 ⊗ |0⟩ = (|00⟩+|10⟩)/√2
→ CNOT: (|00⟩+|11⟩)/√2 (Bell state!)
→ S⊗X: (S|0⟩⊗X|0⟩ + S|1⟩⊗X|1⟩)/√2 = (|0⟩⊗|1⟩ + i|1⟩⊗|0⟩)/√2 = (|01⟩+i|10⟩)/√2
→ H⊗H: Apply H to both qubits...
H|0⟩=(|0⟩+|1⟩)/√2, H|1⟩=(|0⟩-|1⟩)/√2
State → complex expansion... [full calculation on simulator for lab!]
In practice: Run on AerSimulator for complete result.
Main lesson: Complex multi-gate circuits need systematic computation or simulation.
G: Superdense Coding Problems
📡 Superdense Practice
Q19: Alice wants to send "10". Kaunsa gate? Konsa Bell state?
Message 10 → Alice applies Z
(Z⊗I)|Φ+⟩ = (Z|0⟩⊗|0⟩ + Z|1⟩⊗|1⟩)/√2 = (|00⟩-|11⟩)/√2 = |Φ-⟩
Bob decodes: CNOT|Φ-⟩ = |−⟩⊗|0⟩, then H: |1⟩⊗|0⟩ = |10⟩. Measures 10 ✓
🌟 Bonus: Jo Lectures Mein Nahi Tha — Connected Topics
Grover's Algorithm
N items mein ek item dhundna. Classical: average N/2. Quantum Grover's: √N!
Example: 1 million items → Classical: 500,000 avg. Quantum: 1000!
Algorithm:
1. H⊗ⁿ|0⟩ⁿ = equal superposition of all N states
2. Repeat √N times:
a. Oracle: marks correct answer with phase flip |x⟩ → -|x⟩ (if x = answer)
b. Diffusion: inversion about mean — amplifies marked state
3. Measure → correct answer with high probability!
Why √N? Each iteration amplifies correct amplitude by ~2/√N.
After √N iterations, amplitude ≈ 1 → measure correctly!
Shor's Algorithm — RSA Ka Khatma
RSA encryption (HTTPS, banking) iss assumption pe based: large numbers factor karna bohot hard hai.
Shor's algorithm (1994): Quantum computer polynomial time mein factor kar sakta hai!
Core idea: Period finding using Quantum Fourier Transform
To factor N:
1. Choose random a < N
2. Find period r of f(x) = aˣ mod N using QFT
3. gcd(a^(r/2)-1, N) aur gcd(a^(r/2)+1, N) → factors!
Impact: A large fault-tolerant QC could break RSA-2048 in hours.
That's why post-quantum cryptography is being developed now!
Quantum Error Correction
Problem: Noise causes errors. Can't copy qubits (no-cloning).
Solution: Encode info in entanglement (redundancy without copying)
Shor Code: 1 logical qubit → 9 physical qubits
- Protects against bit flip AND phase flip errors
Surface Code (current best):
- 2D grid of qubits
- ~1000 physical qubits per logical qubit (at current error rates)
- Error threshold ~1% per gate
Quantum Computing Applications
Application
Quantum Advantage
Status
Drug Discovery
Exact molecular simulation
Early NISQ experiments
Optimization
QAOA, quantum annealing
Active research
Cryptography (Shor's)
Exponential speedup
Need fault-tolerant QC
Search (Grover's)
√N speedup
Demonstrated
Quantum Sensing
Heisenberg precision limit
Already deployed (atomic clocks)
🎓 Padh liya? Mazaa aaya?
Naye lectures aayein toh update hote rahenge!
Content: Lectures 1-9 | Labs 2-8 | Born Rule | Hermitian/Unitary Matrices
Superdense Coding | Quantum Teleportation | Weekend in Quantum World | Math225