Go to the source code of this file.
Macros | |
#define | CLEANUP_TEST(quregVec, quregMatr) |
Destroys the data structures made by PREPARE_TEST. More... | |
#define | PREPARE_TEST(quregVec, quregMatr, refVec, refMatr) |
Prepares the needed data structures for unit testing unitaries. More... | |
Functions | |
TEST_CASE ("compactUnitary", "[unitaries]") | |
TEST_CASE ("controlledCompactUnitary", "[unitaries]") | |
TEST_CASE ("controlledMultiQubitUnitary", "[unitaries]") | |
TEST_CASE ("controlledNot", "[unitaries]") | |
TEST_CASE ("controlledPauliY", "[unitaries]") | |
TEST_CASE ("controlledPhaseFlip", "[unitaries]") | |
TEST_CASE ("controlledPhaseShift", "[unitaries]") | |
TEST_CASE ("controlledRotateAroundAxis", "[unitaries]") | |
TEST_CASE ("controlledRotateX", "[unitaries]") | |
TEST_CASE ("controlledRotateY", "[unitaries]") | |
TEST_CASE ("controlledRotateZ", "[unitaries]") | |
TEST_CASE ("controlledTwoQubitUnitary", "[unitaries]") | |
TEST_CASE ("controlledUnitary", "[unitaries]") | |
TEST_CASE ("hadamard", "[unitaries]") | |
TEST_CASE ("multiControlledMultiQubitNot", "[unitaries]") | |
TEST_CASE ("multiControlledMultiQubitUnitary", "[unitaries]") | |
TEST_CASE ("multiControlledMultiRotatePauli", "[unitaries]") | |
TEST_CASE ("multiControlledMultiRotateZ", "[unitaries]") | |
TEST_CASE ("multiControlledPhaseFlip", "[unitaries]") | |
TEST_CASE ("multiControlledPhaseShift", "[unitaries]") | |
TEST_CASE ("multiControlledTwoQubitUnitary", "[unitaries]") | |
TEST_CASE ("multiControlledUnitary", "[unitaries]") | |
TEST_CASE ("multiQubitNot", "[unitaries]") | |
TEST_CASE ("multiQubitUnitary", "[unitaries]") | |
TEST_CASE ("multiRotatePauli", "[unitaries]") | |
TEST_CASE ("multiRotateZ", "[unitaries]") | |
TEST_CASE ("multiStateControlledUnitary", "[unitaries]") | |
TEST_CASE ("pauliX", "[unitaries]") | |
TEST_CASE ("pauliY", "[unitaries]") | |
TEST_CASE ("pauliZ", "[unitaries]") | |
TEST_CASE ("phaseShift", "[unitaries]") | |
TEST_CASE ("rotateAroundAxis", "[unitaries]") | |
TEST_CASE ("rotateX", "[unitaries]") | |
TEST_CASE ("rotateY", "[unitaries]") | |
TEST_CASE ("rotateZ", "[unitaries]") | |
TEST_CASE ("sGate", "[unitaries]") | |
TEST_CASE ("sqrtSwapGate", "[unitaries]") | |
TEST_CASE ("swapGate", "[unitaries]") | |
TEST_CASE ("tGate", "[unitaries]") | |
TEST_CASE ("twoQubitUnitary", "[unitaries]") | |
TEST_CASE ("unitary", "[unitaries]") | |
Detailed Description
Unit testing for QuEST's 'unitaries' API. The tests are in alphabetical order of the API doc.
These tests work by constructing, from the unitary specification (e.g. control and target qubits), a full-Hilbert space complex matrix. This is then multiplied onto statevectors, or multiplied and it's conjugate-transpose right-multiplied onto density matrices.
QuEST's user validation handling is unit tested by redefining exitWithError (a weak C symbol) to throw a C++ exception, caught by the Catch2 library.
Definition in file test_unitaries.cpp.
Macro Definition Documentation
◆ CLEANUP_TEST
#define CLEANUP_TEST | ( | quregVec, | |
quregMatr | |||
) |
Destroys the data structures made by PREPARE_TEST.
Definition at line 33 of file test_unitaries.cpp.
◆ PREPARE_TEST
#define PREPARE_TEST | ( | quregVec, | |
quregMatr, | |||
refVec, | |||
refMatr | |||
) |
Prepares the needed data structures for unit testing unitaries.
This creates a statevector and density matrix of the size NUM_QUBITS, and corresponding QVector and QMatrix instances for analytic comparison.
Definition at line 24 of file test_unitaries.cpp.