r/QuantumComputing • • 12d ago

Discussion Simulating a 2²⁷-dimensional Hilbert space in my pocket: Running a 27-qubit QuEST state-vector simulation locally on a $150(CAD) Moto G Play (4GB RAM / ARM64)

Usually, state-vector simulations around 27–30 qubits are reserved for workstations or cloud nodes due to the exponential memory scaling (\(2^n \times 16\text{ bytes}\) in double precision). Just to see where mobile silicon hits a wall, I compiled QuEST (Quantum Exact Simulation Toolkit) natively for ARM64 on an unrooted $150 Moto G Play (2024) (Snapdragon 680, 4GB LPDDR4X RAM) via Termux.

The Benchmark Specs:

• Qubits: 27 (tracking 134,217,728 complex amplitudes simultaneously)

• State Vector Footprint: 2,048.0 MB (locking up 50% of the phone's total physical RAM while Android 14 and a screen recorder stayed running underneath)

• Parallelization: OpenMP enabled across all 8 cores (4x Cortex-A73 + 4x Cortex-A53)

• Runtime & Normalization: Completed in 229.25 seconds (~3m 49s) with Total Prob: 1.000000 (and zero OOM-killer intervention from Android).

Obviously, 28 qubits is a hard wall in double precision since 4,096 MB immediately starves the OS, though compiling with -DPRECISION=1 (single precision) should theoretically let this little Snapdragon squeeze into a 28-qubit state space.

Here is the live execution alongside htop if anyone wants to watch a budget ARM chip grind through a 27-qubit circuit:

https://m.youtube.com/watch?v=86ZEM92j2wA

Note: My YouTube channel only had 3 subs, and 5 videos with less than 300 views combined. It's not monetized. I only posted the link because native video uploads are not enabled on this sub.

60 Upvotes

9 comments sorted by

13

u/Aanavari 12d ago

What is the initial state, Hamiltonian, evolution time etc... Number of qubits is not the only thing that determines the difficulty of a simulation.

2

u/Maiki_Konjo 12d ago

Well, let me be perfectly honest. Half of this if not most goes straight over my head. My dad was a mainframe programmer. Our first computer was a ç64. My own first was a 8088. I'm not a computer whiz. Nor am I computer literate. I'm a dos dinosaur at best.

But at the age of 58 I feel like the DNA is calling and I like to tinker. So I try to put my phone through its paces.

That's about all I can tell you. And in my genuine forthcoming I can only wish that you wish me luck on my learning endeavors rather than to smash down button.

I maybe 58yo, but I still have curiosity to learn. Thank you for your question.

10

u/triaura In Grad School for Quantum 12d ago

Usually you need to benchmark a few algorithms, eg. Grover, QFT. Magic state distillation. GHZ state prep. Before you can claim that you can simulate. Each task brings a different layer of complexity that makes quantum algorithms difficult on classical (entanglement and magic to be precise).

No magic or not a lot, you can get around using Gottesman Knill theorem and Clifford gate set simulation. Not a lot of entanglement you can use tensor product methods. Etc. Full product state, you can literally just store 27 complex 2d vectors

1

u/Maiki_Konjo 12d ago

Well dude, if my video starting with the proof of hardware wasn't a benchmark I can never satisfy your expectations . I don't know what it takes for a supreme guru like you to say good job to a noob like I. But I will say I however say this. In this comment thread one guy has seen my other endeavors and said "don't get stuck in the weeds" referred to my other projects.

→ More replies (1)

5

u/david-marqov Working in Industry 12d ago

I appreciate this video as a fun exploration of the little Motorola, and as you say, it's a nice nod to the work that the thermal and kernel team there did.

PS: Before any of us physics folk get too in the weeds here, go look at the OP's other videos, and appreciate the fun they are having playing with old operating systems and quirky simulations. The Cray X-MP video made me smile.

1

u/Maiki_Konjo 12d ago

You stumbled across them (other posts) despite this being my first post on this sub Reddit? I thank you Sir. It's rather heart warming thing for me when someone gives me an endorsement being a mere learner.

2

u/Cold-Teach-9617 12d ago

Very nice 👍

1

u/CoolblackApps 12d ago

Nice experiment. Fitting 27 qubits into 4 GB without Android killing the process is tight, well done.

Two things that might be fun to try:

  1. Run it once with OMP_NUM_THREADS=4. State-vector simulation is usually limited by memory bandwidth, not by compute. With 4 fast and 4 slow cores, the fast ones often end up waiting for the slow ones. It might run just as fast, or even faster, with 4 threads.
  2. Run a GHZ circuit and a random circuit with roughly the same number of gates. For a state-vector simulator like QuEST the time should be almost the same, because it always updates all 2^27 amplitudes, no matter how entangled the state is. That's very different for the Clifford and tensor network methods mentioned in the other comments.

Our small team builds simulators and benchmarks them a lot, so I'd be curious what numbers you get.