6
$\begingroup$

I want to simulate an arbitrary isolated quantum circuit acting on $n$ qubits (i.e. a pure state of $n$ qubits).

As I know RAM is the bottleneck for quantum simulators, you can consider a "normal" computer to have between $4$ and $8$ Gio of RAM, all the other components are considered sufficiently powerful to not be the bottleneck.

With this definition of a "normal" computer,

What is the maximum value of $n$ (the number of qubits) for which an arbitrary quantum circuit is simulable in a reasonable time ($<1\text{h}$) with a normal computer and freely accessible simulators?

$\endgroup$
6
  • 2
    $\begingroup$ You also need to specify how long you're willing to wait, since there are simulation strategies that use very little space but way more time. $\endgroup$ Commented Jul 24, 2018 at 14:55
  • $\begingroup$ Presumably you're talking about pure states? $\endgroup$
    – DaftWullie
    Commented Jul 24, 2018 at 15:26
  • 1
    $\begingroup$ I edited the question, I talk about pure states. $\endgroup$ Commented Jul 24, 2018 at 15:45
  • $\begingroup$ All other components are sufficiently powerful, yet you limit time? This does not make sense. $\endgroup$ Commented Jul 24, 2018 at 21:08
  • 1
    $\begingroup$ “Arbitrary quantum circuits” are arbitrarily long and so no simulator (or real quantum computer) can complete them within an hour, no matter the number of qubits. $\endgroup$
    – DaftWullie
    Commented Jul 26, 2018 at 20:35

2 Answers 2

7
$\begingroup$

This answer doesn't directly answer the question (I have little experience of real simulators with practical overheads etc.), but here's a theoretical upper bound.

Let's assume that you need to store the whole state vector of $k$ qubits in memory. There are $2^n$ elements that are complex numbers. A complex number requires 2 real numbers, and a real number occupies 24 bytes in python. Let's say we want to cram this into $4\times 10^9$ bytes of RAM (probably leaving a few over for your operating system etc.) Hence, $$ 48\times 2^n\leq 4\times 10^9 $$ Rearrange for $n$ and you have $n\leq26$ qubits.

Note that applying gates in a quantum circuit is relatively inexpensive memory-wise. See the "Efficiency Improvements" section in this answer. From that strategy, one should be able to estimate the time it takes to apply a single one- or two-qubit gate to an $n$-qubit system, and hence how many gates you might expect to fit within some times limit (an hour is very modest, but would certainly serve for illustrative purposes).

$\endgroup$
8
  • $\begingroup$ I'd say that's a fairly accurate estimate: All the memory you need is basically the one used to store the state. $\endgroup$ Commented Jul 24, 2018 at 21:10
  • $\begingroup$ Where do those 24 bytes come from, given that a usual double has 64 bits? $\endgroup$ Commented Aug 15, 2018 at 22:24
  • $\begingroup$ @NorbertSchuch I Have no idea! $\endgroup$
    – DaftWullie
    Commented Aug 16, 2018 at 5:29
  • $\begingroup$ Could it be that it's just not true? $\endgroup$ Commented Aug 17, 2018 at 23:58
  • $\begingroup$ @NorbertSchuch it does seem to be what is consistently claimed online for recent versions of python. There’s nothing wrong with it using 3 times as much memory as you might hope. It’s not like it’s as weird as 24 bits would be. $\endgroup$
    – DaftWullie
    Commented Aug 18, 2018 at 5:12
-1
$\begingroup$

Along with depending on time constraints, as Craig mentioned, you also need to specify how accurate/what gates you want the simulation to have. CHP (CNOT, Phase, Hadamard) simulations can do incredibly large circuits with large numbers of qubits incredible quickly, however they only allow a certain restricted gate set, so some gates, such as T gates, must be approximated.

Other simulations exist (such as quantumsim and others) which store full density matrices, and as a result are much more significantly limited in the number of qubits they work with seeing as they must store a $2^n \times 2^n$ matrix.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.