DEV Community

Swapnil Bhole
Swapnil Bhole

Posted on Originally published at Medium

The Butterfly Effect: Predicting Quantum Echoes

Seven quantum circuits on BlueQubit, three simulators, 2,440 out of 3,000 points.

A butterfly flaps its wings in Brazil, and weeks later there's a tornado in Texas. That's the butterfly effect: tiny changes that ripple into big ones.

Quantum butterfly
Quantum computers have their own butterfly effect, and physicists measure it with something called a quantum echo. I recently worked through seven of these echo problems posted by BlueQubit, and this is the story of how it went, written for people who have never touched a qubit.

The story: forward, flap, rewind

Picture a quantum circuit as a movie:

  1. Play it forward. The qubits interact and get tangled together.
  2. Flip one qubit. This is the butterfly.
  3. Play it backward. Rewind everything exactly.
  4. Check each qubit. How strongly does its echo come back?

Without the flip, rewinding would bring every qubit home perfectly. With it, some qubits come back changed and some barely notice. The task was to predict, for every qubit, a single number between −1 and +1 describing that echo. Physicists call this an out-of-time-order correlator, or OTOC. The true answers were hidden, and my score depended on how closely my pattern of numbers matched them.

Why you can't just simulate it

A full state-vector representation of n qubits stores 2ⁿ complex amplitudes. At 16 bytes per amplitude, every additional qubit doubles the memory required:

Qubits Memory for an exact simulation
25 0.5 GB (a laptop)
30 17 GB (one GPU)
36 1.1 TB
38 4.4 TB

The circuits went from 4 qubits to 38. At 36–38 qubits, straightforward full-state simulation exceeds the memory available on many individual machines. Approximations become attractive, but their accuracy needs to be checked.

Three ways to follow a butterfly

BlueQubit lets you run the same circuit on different simulators by changing one word in your code. I used three:

  • Exact (cpu, gpu): keep every possibility. Perfect, but only for smaller circuits.
  • MPS (mps.cpu, mps.gpu): keep only the strongest links between neighbouring qubits. The knob is the bond dimension χ; higher is closer to the truth, and slower.
  • Pauli path (pauli-path): follow only the loudest "storylines" through the circuit and drop the faint ones. The knob is a threshold; lower is closer to the truth, and slower.

How the seven circuits went

Circuit Qubits What worked Score
S1, S2, S3 4, 16, 25 Exact 300 / 300
G1 (chain) 30 Exact on GPU 300 / 300
G2 (chain with weak links) 36 MPS 600 / 600
G3 (6×6 grid) 36 MPS, after Pauli path failed 640 / 800
G4 (6×6 grid + 2) 38 Pauli path, tightened 600 / 1,000
Total 2,440 / 3,000

My favourite result was G2. The qubits sit in a chain with two weak links in it. Between those links the echo came back strong; everywhere else it was essentially zero. The weak links fenced the butterfly's effect in.

What the butterfly taught me

Check the boring stuff first. Quantum software disagrees about which end of a label is qubit 0. Before spending a single credit, I wrote a tiny simulator that ran on my laptop, ran the smallest practice circuit both ways, and only moved on when BlueQubit's answers matched mine exactly. Every point after that depended on that check.

Practice can mislead. On the practice grid, Pauli path matched the exact answer almost perfectly, so I trusted it on the real grid (G3). It quietly returned zeros for most qubits and scored 240 out of 800. The faint storylines it threw away were the answer. Switching to MPS, then rerunning the largest values at a higher bond dimension, took it to 640. A method only transfers if the practice looks like the real problem.

If it still moves, it isn't done. On G2, one qubit read 0.93 at χ = 64 and 0.64 at χ = 256. On G4, tightening the Pauli-path threshold moved some values by 4–7× and lifted the score from 400 to 600. A converged answer is one that stops changing when you give it more resources.

Change one thing at a time. Each circuit allowed ten tries, and only the best counted. Changing one thing per try turned the scoreboard into a lab instrument: when a single qubit's new value cost 160 points, I knew exactly what to undo. The platform's limits (one GPU job at a time, ten CPU jobs) shaped the plan too, so I kept the GPU on the hardest qubits and ran CPU jobs in parallel.

What I'd try next

  • G4: about a dozen qubits never got the tighter threshold. Earlier refinements moved some values several times over, so that's where the missing points are.
  • G3: a few qubits flipped sign between bond dimensions, which means they weren't converged yet. The next step is χ = 256 on the large values.

Thanks

Thanks to the BlueQubit team and the MidWest Quantum Hackathon for a beautiful set of problems, and for a platform where exact, MPS and Pauli-path simulations, on CPU or GPU, are one word apart.

If you want to try it yourself, BlueQubit's tutorials are a good place to start: app.bluequbit.io/tutorials.


Originally published on Medium.

About the author

I’m Swapnil Bhole, an Electrical and Computer Engineering graduate from the University of Michigan (UMich), Ann Arbor. I enjoy exploring problems across quantum computing, computer architecture, and high-performance computing.

Connect: Portfolio · LinkedIn

Top comments (0)