The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches
The Quantum Exact Simulation Toolkit

The QuEST logo
DOI
GitHub release Doc MIT license
Note
QuEST v4 has been released which re-designed QuEST from the ground up. Read about the exciting new features here.

The Quantum Exact Simulation Toolkit (QuEST) is a high-performance simulator of quantum statevectors and density matrices. It hybridises multithreading, GPU acceleration and distribution to run lightning fast on laptops, desktops and supercomputers, parallelising over multiple cores, CPUs and GPUs. Behind the scenes, QuEST leverages OpenMP, MPI, CUDA, HIP, Thrust, cuQuantum and GPUDirect for cutting-edge performance on modern multi-GPU clusters, and compatibility with older NVIDIA and AMD GPUs. These deployments can be combined in any combination, or automatically decided at runtime, yet are abstracted behind a single, seamless interface, accessible by both C and C++ and all the major compilers (detailed here).

Languages Languages OS OS OS
Platforms Platforms Platforms Platforms

QuEST development is led by the QTechTheory group at the University of Oxford, with active contributions from the EPCC team at the University of Edinburgh, and support from the below organisations. In particular, QuEST v4 was made possible through the support of the UK National Quantum Computing centre (NQCC200921) and the UKRI SEEQA project.

NQCC   AMD   NVIDIA   Quantum Motion   University of Edinburgh   University of Oxford  

To learn more:


🎉  Introduction

QuEST has a simple interface which is agnostic to whether it's running on CPUs, GPUs or a networked supercomputer.

Qureg qureg = createQureg(30);
applyHadamard(qureg, 0);
applyControlledRotateX(qureg, 0, 1, angle);
reportQureg(qureg);
qreal prob = calcProbOfQubitOutcome(qureg, 0, outcome);
qreal expec = calcExpecPauliStr(qureg, getPauliStr("XYZ"));
qreal calcExpecPauliStr(Qureg qureg, PauliStr str)
qreal calcProbOfQubitOutcome(Qureg qureg, int qubit, int outcome)
void initRandomPureState(Qureg qureg)
void applyHadamard(Qureg qureg, int target)
void applyFullQuantumFourierTransform(Qureg qureg)
void applyControlledRotateX(Qureg qureg, int control, int target, qreal angle)
PauliStr getPauliStr(const char *paulis, int *indices, int numPaulis)
Definition paulis.cpp:296
Qureg createQureg(int numQubits)
Definition qureg.cpp:279
void reportQureg(Qureg qureg)
Definition qureg.cpp:371
Definition qureg.h:49

Yet, it is flexible

mixDepolarising(qureg, targ, prob);
mixKrausMap(qureg, targs, ntargs, krausmap);
applyQubitMeasurement(qureg, targ);
applyMultiQubitProjector(qureg, targs, outcomes, ntargs);
applyControlledPauliGadget(qureg, ctrl, paulistr, angle);
applyMultiStateControlledSwap(qureg, ctrls, states, nctrls, targ1, targ2);
multiplyCompMatr1(qureg, targ, getInlineCompMatr1( {{1,2i},{3i,4}} ));
multiplyDiagMatrPower(qureg, targs, ntargs, diagmatr, exponent);
void mixDepolarising(Qureg qureg, int qubit, qreal prob)
void mixKrausMap(Qureg qureg, int *targets, int numTargets, KrausMap map)
CompMatr1 getInlineCompMatr1({{ matrix }})
void multiplyCompMatr1(Qureg qureg, int target, CompMatr1 matrix)
void multiplyDiagMatrPower(Qureg qureg, int *targets, int numTargets, DiagMatr matrix, qcomp exponent)
int applyQubitMeasurement(Qureg qureg, int target)
void applyControlledPauliGadget(Qureg qureg, int control, PauliStr str, qreal angle)
void applyMultiQubitProjector(Qureg qureg, int *qubits, int *outcomes, int numQubits)
void applyMultiStateControlledSwap(Qureg qureg, int *controls, int *states, int numControls, int qubit1, int qubit2)

and extremely powerful

setFullStateDiagMatrFromMultiVarFunc(fullmatr, myfunc, ntargsPerVar, nvars);
applyFullStateDiagMatrPower(qureg, fullmatr, exponent);
setCompMatr(matr, ...);
applyCompMatr(qureg, targs, 10, matr);
0.123 XXIXX
1.23i XYZXZ
-1-6i IIZII
)");
applyTrotterizedPauliStrSumGadget(qureg, observ, time, order, nreps);
Qureg reduce = calcPartialTrace(qureg, targs, ntargs);
qreal expec1 = calcExpecPauliStrSum(reduce, observ);
qreal expec2 = calcExpecFullStateDiagMatr(qureg, fullmatr);
qreal calcExpecFullStateDiagMatr(Qureg qureg, FullStateDiagMatr matr)
qreal calcExpecPauliStrSum(Qureg qureg, PauliStrSum sum)
Qureg calcPartialTrace(Qureg qureg, int *traceOutQubits, int numTraceQubits)
CompMatr createCompMatr(int numQubits)
Definition matrices.cpp:211
void setFullStateDiagMatrFromMultiVarFunc(FullStateDiagMatr out, qcomp(*func)(qindex *), int *numQubitsPerVar, int numVars, int areSigned)
Definition matrices.cpp:694
void setCompMatr(CompMatr matr, qcomp **vals)
Definition matrices.cpp:427
void applyCompMatr(Qureg qureg, int *targets, int numTargets, CompMatr matr)
void applyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)
void applyTrotterizedPauliStrSumGadget(Qureg qureg, PauliStrSum sum, qreal angle, int order, int reps)
PauliStrSum createInlinePauliStrSum(const char *str)
Definition paulis.cpp:418

✅  Features

QuEST supports:

  • ☑️   density matrices for precise simulation of noisy quantum computers
  • ☑️   general unitaries with any number of control, control-states, and target qubits
  • ☑️   general decoherence channels of any dimension
  • ☑️   general observables in the Pauli or diagonal-Z bases
  • ☑️   many many operators, including Pauli gadgets, trotterised time evolutions, and projectors
  • ☑️   many tools to analyse quantum states, such as calculations of probability, fidelity, expectation value, distances and partial traces
  • ☑️   variable precision through qreal and qcomp numerical types which can use single, double or quad precision
  • ☑️   direct access to amplitudes for rapid custom modification of the quantum state
  • ☑️   native compilation on MacOS, Linux and Windows, through Clang, GNU, Intel, and MSVC compilers
  • ☑️   hybridisation of multithreading, GPU-acceleration, distribution and GPU-distribution
  • ☑️   optimisation using NVLink'd GPUs, cuQuantum, and CUDA-aware MPI
  • ☑️   automatic deployment of a Qureg to the optimal hardware at runtime
  • ☑️   hardware probing to determine how many qubits can be simulated at runtime
  • ☑️   bespoke algorithms to optimally simulate a wide variety of esoteric operations

📖  Documentation

Important
QuEST v4's documentation is still under construction!

Visit the docs for guides and tutorials, or the API which is divided into:


🚀  Getting started

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

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

We recommend working in a build directory:

mkdir build
cd build

Compile the minimum example using cmake:

cmake ..
make

then run it with

./min_example

See the docs for enabling acceleration and running the unit tests.


❤  Acknowledgements

In addition to QuEST's authors, we sincerely thank the following external contributors to QuEST.


📰  Related projects