diff --git a/AUTHORS.txt b/AUTHORS.txt index 05062cdd1..52b296a36 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -9,6 +9,7 @@ Mr Tyson Jones [developer] architecture interface quantum ops + testing Dr Balint Koczor [developer] Kraus maps debugging @@ -20,6 +21,8 @@ Dr Ian Bush [consultant] Prof Simon Benjamin [consultant] user requirements algorithm prototyping +Dr Fergus Cooper [developer] + continuous integration Past members: Dr Mihai Duta @@ -28,3 +31,5 @@ Dr Mihai Duta External contributors: Dr Nicolas Vogt on behalf of HQS Quantum Simulations implemented mixDamping +Kshitij Chhabra + patched validateNumQubitsInQureg diff --git a/QuEST/src/GPU/QuEST_gpu.cu b/QuEST/src/GPU/QuEST_gpu.cu index 17aff8948..70c1ff82c 100755 --- a/QuEST/src/GPU/QuEST_gpu.cu +++ b/QuEST/src/GPU/QuEST_gpu.cu @@ -331,6 +331,8 @@ void statevec_destroyQureg(Qureg qureg, QuESTEnv env) // Free GPU memory cudaFree(qureg.deviceStateVec.real); cudaFree(qureg.deviceStateVec.imag); + cudaFree(qureg.firstLevelReduction); + cudaFree(qureg.secondLevelReduction); } int GPUExists(void){ diff --git a/QuEST/src/QuEST_validation.c b/QuEST/src/QuEST_validation.c index c1aee0cc8..276fcb289 100644 --- a/QuEST/src/QuEST_validation.c +++ b/QuEST/src/QuEST_validation.c @@ -280,7 +280,7 @@ void validateNumQubitsInQureg(int numQubits, int numRanks, const char* caller) { QuESTAssert( numQubits <= maxQubits, E_NUM_AMPS_EXCEED_TYPE, caller); // must be at least one amplitude per node - long unsigned int numAmps = (1<= numRanks, E_DISTRIB_QUREG_TOO_SMALL, caller); } diff --git a/README.md b/README.md index 45b2d9447..fae86b338 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ To file a bug report or feature request, [raise a github issue](https://github.c QuEST uses the [mt19937ar](http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html) 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](http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/2003/0303/cuj0303meyers/index.htm) by Randy Meyers and Dr. Thomas Plum -Thanks to [HQS Quantum simulations](https://quantumsimulations.de/) for contributing the `mixDamping` function. +We thank [HQS Quantum simulations](https://quantumsimulations.de/) for contributing `mixDamping` on CPU, and [Kshitij Chhabra](https://github.com/kshitijc) for patching some validation bugs. --------------------------------- @@ -152,5 +152,5 @@ QuEST is released under a [MIT Licence](LICENCE.txt) ## Related projects -- QuEST utilities and extensions -* [PyQuEST-cffi](https://github.com/HQSquantumsimulations/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. * [QuESTlink](https://questlink.qtechtheory.org): a Mathematica package allowing symbolic circuit manipulation and high performance simulation with remote accelerated hardware. +* [PyQuEST-cffi](https://github.com/HQSquantumsimulations/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. diff --git a/examples/tutorial_example.c b/examples/tutorial_example.c index 4b0971c8d..5c946f164 100644 --- a/examples/tutorial_example.c +++ b/examples/tutorial_example.c @@ -91,16 +91,16 @@ int main (int narg, char *varg[]) { qreal prob; prob = getProbAmp(qubits, 7); - printf("Probability amplitude of |111>: %f\n", prob); + printf("Probability amplitude of |111>: %g\n", prob); prob = calcProbOfOutcome(qubits, 2, 1); - printf("Probability of qubit 2 being in state 1: %f\n", prob); + printf("Probability of qubit 2 being in state 1: %g\n", prob); int outcome = measure(qubits, 0); printf("Qubit 0 was measured in state %d\n", outcome); outcome = measureWithStats(qubits, 2, &prob); - printf("Qubit 2 collapsed to %d with probability %f\n", outcome, prob); + printf("Qubit 2 collapsed to %d with probability %g\n", outcome, prob); diff --git a/tests/test_data_structures.cpp b/tests/test_data_structures.cpp index cceab1c49..b37855b4f 100644 --- a/tests/test_data_structures.cpp +++ b/tests/test_data_structures.cpp @@ -161,13 +161,13 @@ TEST_CASE( "createDensityQureg", "[data_structures]" ) { QuESTEnv env = QUEST_ENV; // too many amplitudes to store in type - int maxQb = (int) calcLog2(SIZE_MAX) - 1; + int maxQb = (int) calcLog2(SIZE_MAX) / 2; REQUIRE_THROWS_WITH( createDensityQureg(maxQb+1, env), Contains("Too many qubits") && Contains("size_t type") ); /* n-qubit density matrix contains 2^(2n) amplitudes * so can be spread between at most 2^(2n) ranks */ - int minQb = GENERATE( range(3,10) ); + int minQb = GENERATE_COPY( range(3,maxQb) ); env.numRanks = (int) pow(2, 2*minQb); int numQb = GENERATE_COPY( range(1,minQb) ); REQUIRE_THROWS_WITH( createDensityQureg(numQb, env), Contains("Too few qubits") ); @@ -236,7 +236,7 @@ TEST_CASE( "createQureg", "[data_structures]" ) { REQUIRE_THROWS_WITH( createQureg(maxQb+1, env), Contains("Too many qubits") && Contains("size_t type") ); // too few amplitudes to distribute - int minQb = GENERATE( range(2,10) ); + int minQb = GENERATE_COPY( range(2,maxQb) ); env.numRanks = (int) pow(2, minQb); int numQb = GENERATE_COPY( range(1,minQb) ); REQUIRE_THROWS_WITH( createQureg(numQb, env), Contains("Too few qubits") );