On Sun, 03 Nov 2019 15:06:57 +0000, Krishna Myneni wrote:
> I have developed the following DSL specification for doing simulations
> of a few-qubit (n < 6) quantum circuits in a Forth environment. ...
Some interesting specs below from the Supplementary Information to
Google's Nature paper. Google has their own classical computing
simulation of a quantum circuit. Not too surprisingly, their program is
named "qsim", and they also have another program called "qsimh".
The qsim program can run a 38-qubit wide quantum circuit simulation with
a depth of hundreds of gates within a couple of hours on one of their
Google Cloud nodes (n1-ultramem-160) with the following specs:
4 CPUs with 20 cores/CPU
3844 GB RAM
single precision fp arithmetic
AVX/FMA vectorization instructions
OpenMP multi-threading
Since a 38-qubit quantum state requires a representation involving 2^38
complex numbers, the state vector itself must take up over 2 TB of memory
(at single precision). The matrix representations for the gate operations
must be highly compressed, i.e. not expanded into the full dimensions --
it will be interesting to look at the algorithms if their code is open
source.
My Forth program, qcsim.4th, uses straightforward full matrix
representation for the gates, which is very inefficient both
computationally and for storage at low gate depth. There must be a clever
trick to representing the gates at lower dimension even as the number of
qubits being entangled increases. In any event, the purpose of qcsim.4th
is pedagogical, and with adequate allocation of memory will probably run
satisfactorily for n=8 qubits, although I haven't tested it beyond n=5.
qcsim.4th appears to be working correctly, based on a self-consistency
check of the fidelity benchmark defined in the paper. Since the program
performs a double-precision calculation of a quantum circuit with no gate
or readout errors, the fidelity of the output state should be very close
to one after averaging over a number of random circuits, but not exactly
one, for small n, per their definition. I can detect this difference in
my calculations. Some other tests can be performed on the output
probability distributions.
Krishna Myneni