![]() |
The Quantum Exact Simulation Toolkit v4.2.0
|
Testing utilities for loading environment variables which configure the unit tests, independent of QuEST's internal environment variable facilities. More...
Functions | |
int | getMaxNumTestedQubitPermutations () |
int | getMaxNumTestedSuperoperatorTargets () |
int | getNumQubitsInUnitTestedQuregs () |
int | getNumTestedMixedDeploymentRepetitions () |
bool | getWhetherToTestAllDeployments () |
Variables | |
const int | TEST_ALL_DEPLOYMENTS = 1 |
const int | TEST_MAX_NUM_QUBIT_PERMUTATIONS = 0 |
const int | TEST_MAX_NUM_SUPEROP_TARGETS = 4 |
const int | TEST_NUM_MIXED_DEPLOYMENT_REPETITIONS = 10 |
const int | TEST_NUM_QUBITS_IN_QUREG = 6 |
Testing utilities for loading environment variables which configure the unit tests, independent of QuEST's internal environment variable facilities.
int getMaxNumTestedQubitPermutations | ( | ) |
Definition at line 54 of file config.cpp.
int getMaxNumTestedSuperoperatorTargets | ( | ) |
Definition at line 60 of file config.cpp.
int getNumQubitsInUnitTestedQuregs | ( | ) |
Definition at line 48 of file config.cpp.
int getNumTestedMixedDeploymentRepetitions | ( | ) |
Definition at line 66 of file config.cpp.
bool getWhetherToTestAllDeployments | ( | ) |
Definition at line 72 of file config.cpp.
const int TEST_ALL_DEPLOYMENTS = 1 |
Definition at line 73 of file config.hpp.
const int TEST_MAX_NUM_QUBIT_PERMUTATIONS = 0 |
Specifies the maximum number of control and target qubit permutations for which to unit test each relevant API function.
Many QuEST functions accept a varying number of target qubits (like applyCompMatr()) and/or control qubits (like applyMultiControlledCompMatr()). The unit tests will run these functions, passing every possible number of target qubits (alongside every possible number of control qubits, if possible), from one (zero) up to the number contained within the tested Qureg
(minus the number of target qubits).
For each of these tested number-of-targets and number-of-controls combinations, there are factorially-many possible choices of the arbitrarily-ordered qubit indices, i.e. sub-permutations of all Qureg qubits. By default, the unit tests deterministically check every permutation in-turn. This can become prohibitively slow when the tested Qureg
are large. For example, there are 604,800
unique, non-overlapping choices of 4
targets and 3
controls in a Qureg containing 10
qubits.
When this environment variable is set to a non-zero value, the unit tests will forego testing every permutation and instead perform only the number specified, randomising the involved qubits. This can significantly speed up the tests though risks missing esoteric edge-cases. The runtime of the tests are approximately linearly proportional to the specified number of permutations. When the specified non-zero value exceeds the number of unique permutations, the tests will revert to deterministically evaluating each once.
0
(default) to systematically test all permutations.50
) to test (at most) that many random permutations and accelerate the tests.Definition at line 67 of file config.hpp.
const int TEST_MAX_NUM_SUPEROP_TARGETS = 4 |
Definition at line 70 of file config.hpp.
const int TEST_NUM_MIXED_DEPLOYMENT_REPETITIONS = 10 |
Definition at line 76 of file config.hpp.
const int TEST_NUM_QUBITS_IN_QUREG = 6 |
Definition at line 36 of file config.hpp.