Releases: QuEST-Kit/QuEST
v3.2.0
Overview
This release adds a new encapsulation for representing Hamiltonians in the Pauli basis, adds efficient representation of diagonal operators, adds continuous time simulation through Trotter-Suzuki decompositions, and enables multiplying arbitrary complex matrices directly onto quantum states.
New features
Added a new type, PauliHamil, representing a weighted sum of Pauli strings; a common basis for representing Hamiltonians.
createPauliHamil()createPauliHamilFromFile()initPauliHamil()destroyPauliHamil()reportPauliHamil()applyPauliHamil()calcExpecPauliHamil()
Added the ability to generate Trotter circuits, including higher order 'symmetrized' Suzuki decompositions. This can be used to unitarily evolve a state in time, under a given PauliHamil. The gates prescribed by the decomposition can be captured with QASM logging.
applyTrotterCircuit()
Added a new type, DiagonalOp, which can represent non-unitary and even non-Hermitian diagonal operators acting on the full Hilbert space. The data for this operator is distributed, and persists in GPU memory, for rapid simulation.
createDiagonalOp()destroyDiagonalOp()initDiagonalOp()syncDiagonalOp()applyDiagonalOp()calcExpecDiagonalOp()
Added support for directly multiplying arbitrary complex matrices onto a state-vector or density-matrix.
applyMatrix2()applyMatrix4()applyMatrixN()applyMultiControlledMatrixN()
Bug fixes
- fixed OpenMP linking on MacOS (by external contributor, Drew Silcock @drewsilcock)
- fixed CUDA compiling with CMake (by external contributor, @SachinCompton)
- fixed multithreading with gcc-9 (with help from external contributor, Zach van Rijn @zv-io)
- tweaked unit testing precision tolerances
v3.1.1
Overview
Patching a GPU memory leak, and some minor bugs in the build and validaition.
Bug fixes
- Issue #239: patched a memory leak in
destroyQuregon GPU (Tyson Jones) - PR #230: patched bug in
createQureg's validation, which prevented creating quregs larger than32qubits (Kshitij Chhabra) - Issue #236: Patched cmake build so that flags (like
PRECISION) are given also to user source (Ania Brown) - Patched tutorial warnings when
PRECISION != 2(madeprintfprecision-agnostic) (Tyson Jones)
Acknowledgements
We thank Kshitij Chhabra for their well-spotted bug fix in createQureg!
v3.1.0
Overview
This release introduces rigorous unit testing of the QuEST API, sets-up continuous-intergration, improves validation, and gives the documentation a face-lift. We thank Fergus Cooper for setting up QuEST's CI.
Unit tests
tests/ now contains a suite of hardware-agnostic unit tests which rigorously check every inch of the QuEST API. We compare the optimised calculations that QuEST performs, against slow, unoptimised but provably correct calculation. We check every possible, meaningfully distinct input to every QuEST function (for example, all possible arrangements of control and target qubits) gives the correct behaviour.
With these tests, we have almost absolute assurance that the QuEST API does what it says on the tin.
These tests can be run with
mkdir build && cd build
cmake .. -DTESTING=ON
make
make testRead more about the new tests in this PR, and view the tests in the doc.
Validation
QuEST will now report if it is being initialised incorrectly. For example, trying to distribute QuEST over a non-power-of-2 number of nodes will fail gracefully, with an error message. It will also report if it cannot fit an attemptedly-created Qureg in memory, if for example it is too large, or too small to distribute.
Doc
Finally, the documentation has been restyled.
v3.0.1
Bug fixes
Issue #148: Fixed CMake compilation issue for GPU mode on MacOS.
Issue #210: Fixed distributed mixDamping which previously gave an incorrect result when targeting the final qubit in the density matrix.
(No Issue): Fixed distributed controlledTwoQubitUnitary and multiControlledUnitary. Gave incorrect results when targeting qubits of indices < #totalqubits - log2(#nodes) with control qubits which included 0 and/or 1.
This release is the first to be thoroughly unit tested serially, with multithreading, with GPU accleration, and with distribution of 2, 4 and 8 nodes, on Ubuntu and MacOS.
v3.0.0
Overview
This release adds several powerful operations, like general unitaries (that's any unitary matrix, any number of control qubits, and any number of target qubits), general decoherence channels, and some all-qubit operations and expectation-value calculations. It improves the usability of the ComplexMatrix type, and improves the documentation.
Tyson Jones thanks his favourite rubber duck; Sinan Shi.
New features
- refactored
ComplexMatrix2into a 2D array.
This allows much easier initialisation, as demonstrated in this PR.
- added
ComplexMatrix4andComplexMatrixNtypes. - added
createComplexMatrixN() - added
destroyComplexMatrixN() - added
getStaticComplexMatrixN() - added
initComplexMatrixN()
These are for specifying two-qubit and N-qubit general unitaries and noise operators.
- added
twoQubitUnitary() - added
controlledTwoQubitUnitary() - added
multiControlledTwoQubitUnitary() - added
multiQubitUnitary() - added
controlledMultiQubitUnitary() - added
multiControlledMultiQubitUnitary()
These functions effect general unitaries, even in distributed mode, which to the best of our knowledge, is currently a unique QuEST facility!
- added
mixPauli() - added
mixKrausMap() - added
mixTwoQubitKrausMap() - added
mixMultiQubitKrausMap()
These functions allow the simulation of general noise processes on density matrices, through any completely positive map, expressed via Kraus operators!
- added
enum pauliOpType - added
calcExpecPauliSum() - added
calcExpecPauliProd()
These allow the calculation of the expected value of weighted sums and products of Pauli operators (and ergo, Pauli-basis Hamiltonians), of both state-vectors and density matrices.
- added
multiRotateZ() - added
multiRotatePauli() - added
swapGate() - added
sqrtSwapGate() - added
multiStateControlledUnitary()
A handful of multi-qubit unitaries.
- added
applyPauliSum() - added
initBlankState() - added
setWeightedQureg() - added
createCloneQureg() - added
copyStateToGPU() - added
copyStateFromGPU()
These functions allow more direct modifications of the quantum state, in order to produce possibly un-physical states.
- added
calcHilbertSchmidtDistance() - added
calcDensityInnerProduct()
These are calculations primarily for density matrices.
- exposed
invalidQuESTInputError()
This allows user to choose how invalid user-input to QuEST is handled (and hence, recovered from).
- Restructured documentation into groups
The API is now grouped into several categories (e.g. Unitaries and Calculations) for easier reading.
API breaking changes
ComplexMatrix2became a struct (.realand.imagfields) of 2D arrays ofqreal(no longer containComplex)applyOneQubitDephaseErrorbecamemixDephasingapplyTwoQubitDephaseErrorbecamemixTwoQubitDephasingapplyOneQubitDepolariseErrorbecamemixDepolarisingapplyOneQubitDampingErrorbecamemixDampingaddDensityMatrixbecamemixDensityMatrixinitStateDebugbecameinitDebugState(not present in API previously)
Bug fixes
- error in
initPureState(effected only CPU code) - error in
controlledPhaseShift(effected only GPU code) - fixed all known compiler warnings
- Mingw32 compiler issues
v2.1.0
New features
- applyOneQubitDampingError function added: Mixes a density matrix to induce single-qubit damping (decay to 0 state, or zero temperature qubit damping)
- New build system
- New testing framework
API breaking changes
- seedQuESTDefault is now seeded only by PID and time in milliseconds, not also using the hostname of the node on which the process is running. This makes it significantly more likely that QuEST will compile successfully on new OS. hostname should not have been contributing significantly to the effectiveness of the seeding -- it would only matter when multiple instances of QuEST were spawned on different nodes at the same millisecond.
Build system changes
- QuEST can now be built using cmake as described in the QuEST tutorial. This should improve the cross-platform support of QuEST. In case of problems with the new system, a makefile in the old style is provided in examples.
Testing framework changes
- Test suite rewritten with Python3, for test framework interfacing with main QuEST library and integrated into new Cmake build system (make test).
- Test suite allows more extensible and unified testing structure for ease of maintainability as QuEST expands.
Bug fixes
- Issue #118: Fixed compilation issues related to gethostname in some Windows environments by removing seeding by hostname from
seedQuESTDefault - Issue #122: Fixed bug in
calcFidelitywhen performed on a density matrix, when running on CPU(s) (i.e. GPU code unaffected) - Issue #126: Fixed bug in
multiControlledPhaseShiftwhen performed on a density matrix - Issue #140: Fixed bug in
controlledPauliYwhen running in distributed mode - Also see one bug fix in Milestone v2.0.1
Related issues and pull requests
v2.0.1
Bug Fixes
Issue #113: Fixed error in function seedQuESTDefault() when running in distributed mode on more than one process. This bug made it possible for multiple functions to disagree on a measurement outcome, leading to potential incorrect operation of the following functions: measure(), measureWithStats()
Related issues
v2.0.0
New features
-
Density matrices
- In addition to statevectors, all gates/measurements/state-initialisers can be performed on new density matrix representations of the (now, possibly mixed) quantum states, which can be simulated on all hardware backends.
- Density matrices can be initialised to any pure state (e.g. through
initZeroState,initPureState,initClassicalState). - Density matrices can undergo one and two qubit dephasing and depolarising noise, through
applyOneQubitDephaseError,applyTwoQubitDepolarisingError, etc. getDensityAmpaddDensityMatrixcalcPuritycalcFidelity
-
QASM generation. All gates can be recorded into a QASM log, including those which require decomposition into multiple native QASM operations.
startRecordingQASMstopRecordingQASMclearRecordedQASMprintRecordedQASMwriteRecordedQASMToFile
-
qcomp, a precision-agnostic complex type which supports operators, and resolves to the standard complex type ofCorC++, depending on the user's language. This is optionally imported with#include <QuEST_complex.h>. For example, ifQuEST_PREC=4atC++compile time, thenqcomp xwill resolve tocomplex<long double> x. This is useful for performing complex algebra when calculating e.g. unitary gate arguments, and can be converted to/from the QuESTComplexstruct with:toComplexfromComplex
-
a centralised user-input validation system which catches 28 user errors, such as mismatching qureg dimensions, invalid noise probabilities, attempted collapse to impossible measurement outcomes, etc.
-
other additional functions
calcFidelitycalcInnerProductcloneQureggetAmpsetAmpsinitStateFromAmps- Quregs are automatically in the zero state after creation.
API breaking changes:
- typedef
REALbecameqreal void initQuESTEnv(QuESTEnv* env)becameQuESTEnv createQuESTEnv()closeQuESTEnvbecamedestroyQuESTEnvMultiQubitbecameQuregcalcTotalProbabilitybecamecalcTotalProbfindProbOfOutcomebecamecalcProbOfOutcomeinitStatePlusbecameinitPlusStateinitStateZerobecameinitZeroStatesigmaXbecamepauliX(same forYandZ)controlledSigmaXbecamecontrolledPauliX(same forYandZ)getProbElbecamegetProbAmpgetRealAmpElbecamegetRealAmp(same forImag)
Build system changes:
- Compilation is now part of the unit testing
- User can optionally
#include <QuEST_complex.h>for a native complex type
v1.1.0
New features
- compatibility with
CandC++on any target hardware - API now identical for all target hardware (
getProbEland controlled-rotate gates added on GPU) - convenience scripts for unit testing
- compiler compatibility testing
- seeding now default when creating QuEST env
initClassicalState
Build system changes
- new build process targets CPUs, GPUs, network with single makefile, with explicit support for GNU, Intel and Clang compilers
- source files can mix
CandC++ - improved compatibility with older compilers
- resolved compiler warnings
Bug fixes
- fixes in unit testing routines
v1.0.0
New features
- ControlledRotateAroundAxis, ControlledRotateX, ControlledRotateY, ControlledRotateZ
- QuESTSeedRandomDefault uses pid, time and hostname as opposed to just pid and time
- QuESTSeedRandom allows user to specify their own seeds
For full v1.0.0 API, see https://aniabrown.github.io/QuEST/QuEST_8h.html
API breaking changes
- qubits.h renamed to QuEST.h -- #include "qubits.h" needs to be changed to #include "QuEST.h" in user circuit files
- the Mersenne Twister random number generator used for measure and measureWithStats is no longer seeded by default when you call initQuESTEnv. Instead, you need to call QuESTSeedRandomDefault to seed by pid, time and hostname, or QuESTSeedRandom for user defined seeding.
Build system changes
- there is now an example makefile and example circuit file in the root directory. This means the code can be tested very quickly after downloading using "make; ./demo" in the root directory. For developers -- make sure that these files are exact copies of those in the examples folder when comitting.
- include directory is now passed to the compiler, which means you can use #include "QuEST.h" as opposed to #include "/pathtoQuEST/QuEST.h" as before
Bug fixes
- rotateAroundAxis, rotateX, rotateY and rotateZ were using the wrong equation and not normalising the input vector correctly -- this is now fixed