QuEST Documentation

The QuEST logo

GitHub release Doc unit tests MIT license

The Quantum Exact Simulation Toolkit is a high performance simulator of quantum circuits, state-vectors and density matrices. QuEST uses multithreading, GPU acceleration and distribution to run lightning first on laptops, desktops and networked supercomputers. QuEST just works; it is stand-alone, requires no installation, and trivial to compile and getting running.

Languages Languages OS OS OS Platforms Platforms Platforms

QuEST is developed by the QTechTheory group at the University of Oxford, and these authors. To learn more:

DOI Email


:tada:  Introduction

QuEST has a simple interface, which is agnostic to its runtime environment, between CPUs, GPUs and over networks.

hadamard(qubits, 0);
controlledRotateX(qubits, 0, 1, angle);
double prob = calcProbOfOutcome(qubits, 0, outcome);

Yet, it is flexible

v.x = 1; v.y = .5; v.z = 0;
rotateAroundAxis(qubits, 0, angle, v);
.real = {{.5, .5}, { .5,.5}},
.imag = {{.5,-.5}, {-.5,.5}}};
unitary(qubits, 0, u);
mixDepolarising(qubits, 0, prob);

and extremely powerful

int ctrls[] = {0, 1, 2};
int targs[] = {5, 20, 15, 10, 25};
multiControlledMultiQubitUnitary(qubits, ctrls, 3, targs, 5, u);
ComplexMatrixN k1, k2, k3 = ...
mixMultiQubitKrausMap(qubits, targs, 5, {k1, k2, k3}, 3);
double val = calcExpecPauliHamil(qubits, hamiltonian, workspace);
applyTrotterCircuit(qubits, hamiltonian, time, order, repetitions);

:white_check_mark:  Features

QuEST supports:

  • :ballot_box_with_check:   density matrices for precise simulation of noisy quantum computers
  • :ballot_box_with_check:   general unitaries with any number of control and target qubits
  • :ballot_box_with_check:   general decoherence channels of any dimension
  • :ballot_box_with_check:   general Hermitian operators in the Pauli basis
  • :ballot_box_with_check:   many many operators, including even Pauli gadgets, analytic phase functions and Trotter circuits
  • :ballot_box_with_check:   many tools to analyse quantum states, such as calculations of probability, fidelity, and expected value
  • :ballot_box_with_check:   variable precision through a qreal numerical type which can use single, double or quad precision
  • :ballot_box_with_check:   QASM output to verify simulated circuits
  • :ballot_box_with_check:   direct access to amplitudes for rapid custom modification of the quantum state
  • :ballot_box_with_check:   native compilation on MacOS, Linux and Windows, through Clang, GNU, Intel, and MSVC compilers

:book:  Documentation

For developers: To regenerate the doc after making changes to the code, run doxygen doxyconfig/config in the root directory. This will generate documentation in Doxygen_doc/html, the contents of which should be copied into docs/


:rocket:  Getting started

To rocket right in, download QuEST with git at the terminal

git clone https://github.com/quest-kit/QuEST.git
cd QuEST

Compile the tutorial example (source) using cmake and make

mkdir build
cd build
cmake ..
make

then run it with

./demo


Windows users should install Build Tools for Visual Studio, and CMake, and run the above commmands in the Developer Command Prompt for VS, though using build commands

cmake .. -G "NMake Makefiles"
nmake

If using MSVC and NMake in this way fails, users can forego GPU acceleration, download MinGW-w64, and compile via

cmake .. -G "MinGW Makefiles"
make


:heart:  Acknowledgements

We sincerely thank the following external contributors to QuEST.

QuEST uses the mt19937ar Mersenne Twister algorithm for random number generation, under the BSD licence. QuEST optionally (by additionally importing QuEST_complex.h) integrates the language agnostic complex type by Randy Meyers and Dr. Thomas Plum


:newspaper:  Related projects

  • QuESTlink
    a Mathematica package enabling symbolic circuit manipulation, analytic simulation, visualisation and high performance simulation with remote accelerated hardware.
  • pyQuEST
    a python interface to QuEST, based on Cython, developed within the QTechTheory group. Please note, pyQuEST is currently in the alpha stage.
  • PyQuEST-cffi
    a python interface to QuEST based on cffi developed by HQS Quantum Simulations. Please note, PyQuEST-cffi is currently in the alpha stage and not an official QuEST project.
Represents a 3-vector of real numbers.
Definition: QuEST.h:198
void controlledRotateX(Qureg qureg, int controlQubit, int targetQubit, qreal angle)
Applies a controlled rotation by a given angle around the X-axis of the Bloch-sphere.
Definition: QuEST.c:220
void rotateAroundAxis(Qureg qureg, int rotQubit, qreal angle, Vector axis)
Rotate a single qubit by a given angle around a given Vector on the Bloch-sphere.
Definition: QuEST.c:601
void mixDepolarising(Qureg qureg, int targetQubit, qreal prob)
Mixes a density matrix qureg to induce single-qubit homogeneous depolarising noise.
Definition: QuEST.c:1272
ComplexMatrixN createComplexMatrixN(int numQubits)
Allocate dynamic memory for a square complex matrix of any size, which can be passed to functions lik...
Definition: QuEST.c:1348
qreal z
Definition: QuEST.h:200
qreal calcProbOfOutcome(Qureg qureg, int measureQubit, int outcome)
Gives the probability of a specified qubit being measured in the given outcome (0 or 1).
Definition: QuEST.c:1166
void unitary(Qureg qureg, int targetQubit, ComplexMatrix2 u)
Apply a general single-qubit unitary (including a global phase factor).
Definition: QuEST.c:348
Represents a general 2^N by 2^N matrix of complex numbers.
Definition: QuEST.h:186
qreal calcExpecPauliHamil(Qureg qureg, PauliHamil hamil, Qureg workspace)
Computes the expected value of qureg under Hermitian operator hamil.
Definition: QuEST.c:1219
void multiControlledMultiQubitUnitary(Qureg qureg, int *ctrls, int numCtrls, int *targs, int numTargs, ComplexMatrixN u)
Apply a general multi-controlled multi-qubit unitary (including a global phase factor).
Definition: QuEST.c:330
qreal y
Definition: QuEST.h:200
qreal x
Definition: QuEST.h:200
qreal real[2][2]
Definition: QuEST.h:139
void hadamard(Qureg qureg, int targetQubit)
Apply the single-qubit Hadamard gate.
Definition: QuEST.c:176
void applyTrotterCircuit(Qureg qureg, PauliHamil hamil, qreal time, int order, int reps)
Applies a trotterisation of unitary evolution to qureg.
Definition: QuEST.c:1070
Represents a 2x2 matrix of complex numbers.
Definition: QuEST.h:137