Quantum isn’t just faster- it’s Smarter!
If Day-1 was about meeting qubits like strangers at a new hostel, Day-2 was the part where they actually started telling us secrets. 😅
Today’s sessions were basically three big ideas:
- Finding a hidden string (BV),
- Making graphs behave (MaxCut/QAOA),
- and Searching like a quantum detective (Grover).
All of these had one common hero: the mysterious “oracle🔮,” which I initially imagined as something like a sci-fi fortune teller. Turns out it’s actually a quantum black box that knows something we don’t.
It felt like discovering that quantum computing isn’t about “solving faster” but about asking questions differently.
Almost like the computer whispers,
“I don’t need all the answers. I just need the right question.”
I kinda love that.💜
☕ First topic: What even is an oracle?
Traditionally, you’d call a function, pass arguments, get answers back. Quantum says:
“No no… I won’t tell you the answer. I’ll mark something and you figure it out.” I mean… typical quantum attitude. 😎
An oracle basically hides information inside a unitary gate. You don’t see it, but you feel its effect when amplitudes change. Invisible hands moving things around. Harry-Potter-level stuff. 🎩🪄
Bernstein–Vazirani: The laziest 🥱 algorithm that still wins 🏆
This one was honestly weirdly satisfying. Someone hides a bitstring… like:
101101
Classically: you need multiple queries.
Quantum: one shot — Boom. I know it.
Steps:
- create superposition
- let the oracle whisper its secret as a phase
- undo the superposition (Hadamards again)
- measure
…and the measurement literally prints the secret. Wanna feel the circuit? Here you go..
It felt like yelling into a cave once and getting a sentence-long echo back. Also:
Implemented it in qrisp and actually saw the secret appear in measurement this way..👇🏻
Type caption for image (optional)from qrisp import QuantumVariable, bv_oracle
secret = [1,0,1,1]
q = QuantumVariable(len(secret))
q.H() # creating superposition
bv_oracle(q, secret)
q.H() # extracting the hidden pattern.
result = q.measure()
print(result)🎭MaxCut: a.k.a “separate your friends before exams”
Its just like the age-old technique used by most of the teachers to prevent cheating in exams..!
Imagine students as nodes, friendships as edges. You have two rooms.
Your goal: separate as many friends as possible so cheating becomes harder. That separation is the “cut.”
Get Sarika gangothri’s stories in your inbox
Join Medium for free to get updates from this writer.
Maximize the cut → MaxCut.
Sweet and evil at the same time.🎭
How do we decide to cut? The Cost Function is the Judge here..! Here’s how you formulate a cost function.. Assign each student a qubit. ∣0⟩ to a student in room-0 and ∣1⟩ to a student in room-1.
And here zi=−1 if the qubit is in state∣0⟩ and +1 if qubit is in state∣1⟩. But qubits are {0,1} so we use Zi = 1–2xi. This little conversion is the bridge between physics notation and code.
+1 to the cost function for friends in the same room & -1 to the cost function for friends in different rooms. H(Zi) is minimized when the number of spilt-up friendships is maximal.
QAOA: The Quantum Approximate Optimization Algorithm
Textbook says: It is a hybrid quantum-classical algorithm that leverages the principles of quantum computing to find approximate solutions to difficult combinatorial optimization problems, such as the Max-Cut problem, portfolio optimization in finance, and logistics challenges. 🥸
I’d say.., These variational algorithms feel like quantum meditation, like tuning a guitar by ear.. just this way.🎸🎶
It’s literally probabilistic optimization, which somehow feels poetically fair.
from iqm.qaoa import QAOA
qaoa = QAOA(graph=my_graph, layers=2)
qaoa.train()
samples = qaoa.samples()High-probability samples ≈ good solutions.
Grover’s: The Quantum Google search🔎
If someone like me re-writes an algorithm in future, it’d be this. Grover isn’t about computing the answer — it amplifies the right one.
If classical search digs through a phonebook, Grover rearranges probability so the answer stands out louder than the wrong ones.
Mini code:
from qrisp.grover import groversalg
solution = groversalg(num_qubits=4, marked_states=[5])
print(solution)A correct state “shouting louder” than alternatives. Again, one line- the whole idea.. Sqrt(N) instead of N. Not istant results, but significantly fewer steps for sure..!
🧒 My silly analogies that ACTUALLY helped me
Not part of the session — just my brain trying to cope 😂
- oracle → mysterious magic box
- BV → shout once, full answer echoes back
- MaxCut → stop friends from cheating
- QAOA → tuning guitar strings
- Grover → detective trying fewer clues
Childish? Yes. 🍼
Helpful? Also yes.😎
Honestly… these tiny metaphors end up teaching us more than formulas did. Sometimes simplifying something makes you meet its depth differently.
Some answers don’t come by asking louder.. they come by asking better..! 🤝🏻








