3

Qiskit offers a number of quantum simulators (e.g. AerSimulator, QasmSimulator, StatevectorSimulator). But I don't know how these simulators actually work. Quantum operators and quantum states can be represented by unitary matrices and vectors respectively. So I guess quantum simulators are actually performing matrix multiplications when applying quantum operators on some quantum state? But if this is the case, how could we use them to achieve any quantum advantage over classical computers which do the same thing?

Jay Muntz
  • 147
  • 1
  • 10
Liuji
  • 31
  • 2
  • Hi there, discussions of simulating quantum computations using classical computers is discussed in several places on QC.SE checkout the answer and comments to https://quantumcomputing.stackexchange.com/a/22022/11793 – Condo Mar 15 '22 at 18:21
  • I vote for this question to be closed, as it was already answered in a clear manner in the duplicate. – BrockenDuck Mar 23 '22 at 10:56

1 Answers1

2

But if this is the case, how could we use them to achieve any quantum advantage over classical computers which do the same thing?

We can't. Simulators are used to test a code using a low number of qubits theoretically. Even though some simulators are optimized so that they don't perform $2^n\times2^n$ matrix multiplication for each gate applied on the system, the point is only to ensure that the code one has written yields the correct result.

Indeed, simulating allows one to get the exact statevector, which can be used to test for the correctness of the code. On the other hand, directly running your code on a real quantum computer is cumbersome, since:

  • You don't have access to the final statevector
  • Noise may perturb your measurements

Of course, it is not possible to test a useful circuit with a high number of qubits using a simulator (depending on the circuit, you may not have enough RAM or wait for ages).

As a final note, note that it is possible to define simulators which don't perform $2^n\times2^n$ matrix multiplication. For instance, if you restrict your self to Pauli gates, you are able to efficiently simulate your quantum circuit. Of course, no useful quantum circuit can be decomposed into Pauli gates only, the point is only that for a given assumption on the gates one is allowed to use, it may be possible to optimize the simulator, still without any quantum advanatage.

Tristan Nemoz
  • 6,137
  • 2
  • 9
  • 32
  • Thanks for your detailed explanation! So, even though we implement some quantum algorithm using quantum simulators, we can not get any quantum advantage? I mean quantum advantage might stem from quantum algorithms which solve the same problem in a more efficient way than classical algorithms. – Liuji Mar 21 '22 at 08:27
  • @Liuji Indeed. You can run a quantum algorithm using a classical computer (that's what simulators do), but the time and memory complexities would be exponentially worse, so you would not get any quantum advantage like this. Fundamentally, they are valid, classical, algorithms for the problem they are trying to solve, they're not "quantum algorithms" if they're run on a classical computer. – Tristan Nemoz Mar 21 '22 at 08:51