Skip to content

Commit

Permalink
Merge pull request #240 from QuEST-Kit/develop
Browse files Browse the repository at this point in the history
v3.1.1
  • Loading branch information
TysonRayJones authored Mar 21, 2020
2 parents 50190be + 4c09624 commit e344161
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
5 changes: 5 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Mr Tyson Jones [developer]
architecture
interface
quantum ops
testing
Dr Balint Koczor [developer]
Kraus maps
debugging
Expand All @@ -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
Expand All @@ -28,3 +31,5 @@ Dr Mihai Duta
External contributors:
Dr Nicolas Vogt on behalf of HQS Quantum Simulations
implemented mixDamping
Kshitij Chhabra
patched validateNumQubitsInQureg
2 changes: 2 additions & 0 deletions QuEST/src/GPU/QuEST_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion QuEST/src/QuEST_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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<<numQubits);
long unsigned int numAmps = (1UL<<numQubits);
QuESTAssert(numAmps >= numRanks, E_DISTRIB_QUREG_TOO_SMALL, caller);
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---------------------------------

Expand All @@ -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.
6 changes: 3 additions & 3 deletions examples/tutorial_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);



Expand Down
6 changes: 3 additions & 3 deletions tests/test_data_structures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") );
Expand Down Expand Up @@ -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") );
Expand Down

0 comments on commit e344161

Please sign in to comment.