description
Guide

The Value of Classical Quantum Simulators

Last updated: January 18, 2024
IonQ Staff

Quantum simulators—software programs that allow you to use a classical computer to run quantum circuits as if they were being run on a quantum computer—are increasingly popular tools in the world of quantum computing. Many simulators are available in the quantum ecosystem, from run-it-yourself simulators packaged with open-source tools like Qiskit and Cirq, to standalone, hardware-optimized packages like Intel-QS and NVIDIA cuQuantum, to cloud-based simulators from most of the major quantum cloud providers, like the 29-qubit cloud simulator available as part of The IonQ Quantum Cloud.

The proliferation of quantum simulators raises a few questions: if we can just get a regular computer to pretend to be a quantum computer, why are we trying to build actual quantum hardware in the first place? And, if we have real quantum hardware, why do we need simulators?

First, simulators won’t ever be able to replace real quantum hardware of sufficient size. Second, even with this limitation, simulators are surprisingly useful tools in the world of quantum computing applications and algorithms research. They can help us develop better algorithms, debug code, circumvent the limitations of near-term systems, and more.

Let’s start by explaining why simulators are supporting tools, not replacements for real quantum hardware. A quantum simulator works by simulating the quantum operations of a computer—doing the same type of math, effectively— but it does this at great computational cost. Where a quantum computer handles these operations natively, a classical computer must resort to intense number-crunching.

Because of this, classical computers are only able to simulate quantum computers up to a point. You can probably simulate a quantum program that has only a handful qubits on whatever device you are currently holding or sitting in front of, but because the computational challenge of quantum simulation scales exponentially, this quickly stops being the case. Algorithms with even a few dozen qubits may need specialized hardware, and at something like 50–60 qubits, you can find algorithms that no classical computer could ever simulate.

That said, we love simulation, and are excited to see it become more powerful and useful. We’re even an industry partner for the NVIDIA cuQuantum project, which is designed to hone these simulators, push the limits of what they are capable of, make larger simulations more performant and extend their useful abilities, but even still, there’s only so much that can be done. For large enough calculations, you’ll have to use real hardware.

That’s fine, because simulators aren’t meant to be a replacement for full-scale fault-tolerant hardware. They’re meant to be a tool that lets us get around certain near-term limitations of hardware and helps us understand and develop the algorithms these future systems will be able to solve better than any classical computer.

There are many interesting uses for quantum simulators, we’ll only go over a few here.

First, they provide increased access and faster feedback while working on algorithms. Whether you’re trying novel techniques for the classical portion of an iterative chemistry algorithm, trying different techniques for quantum machine learning, or just working through a textbook and learning how to think in a more “quantum” way, having a quantum computer to actually run things on is critical.

But, there are still only so many in the world, and people working on quantum code may find it too difficult, slow or complicated to run everything on real hardware. We've tried to solve this by making our eleven qubit systems available through all three major cloud service providers, but there are still only so many hours in the day on so many quantum computers, and as such, far more demand for development access to our industry-leading quantum computers than we (or anyone) can currently meet. Being able to simulate simple circuits on your own computer or on a variety of free-to-use cloud simulators like IonQ’s allows for faster iteration and greater flexibility when trying new things.

This fast feedback loop even allows us to find and fix bugs at IonQ: our cloud simulation and optimization pipeline, the chain of tools that turns customer-submitted programs into the smallest, most efficient version of the program to run on hardware, uses a quantum simulator as part of its automated test suite—whenever we change anything in the pipeline, we simulate a series of circuits designed for the task and confirm the outputs are still the same and that our changes didn’t break anything in an unexpected way. Doing this gives us higher confidence when we release new features for the quantum cloud, and using a simulator to do so allows it to happen faster and more efficiently than if we had to use real hardware for testing.

Simulators can also do things for developers that real quantum computers can't, such as let you look into a computation as it’s occurring. In a real quantum system, you have no ability to see the complex state evolution that takes place during computation. All you can do is perform gates and make a measurement — initialization, gates, then output. That’s it. If you try and “peek” at what’s happening, not only do you destroy the in-progress computation by measuring it, you still don’t see the “full” state. Just what’s been measured.

But, because a simulator is simulating this state classically, it’s easy to pause it and look inside at any point to see the full quantum state, in a variety of different representations, as long as it’s been programmed to do so. This has immense utility in debugging algorithms when they’re being designed, in understanding quantum programming, and more.

We’re only a handful of hardware generations from a system that may not be able to be simulated classically—every time you add one more (high quality!) qubit to a quantum system or simulator, you need to store a vector that is double the size of the previous one. The growth is exponential. Simulators will eventually be unable to match the performance of real quantum computers, but even then they will still be valuable sandboxes in which to test algorithms, debug code, and learn how to think in quantum terms.