The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches
compare.hpp
1/** @file
2 * @author Tyson Jones
3 *
4 * @defgroup testutilscompare Compare
5 * @ingroup testutils
6 * @brief
7 * Testing utilities which compare scalars produced by the
8 * QuEST API to those produced by other test utilities, and
9 * Quregs modified by the API to qvector qmatrix references.
10 * @{
11 */
12
13#ifndef COMPARE_HPP
14#define COMPARE_HPP
15
16#include "quest/include/quest.h"
17#include "qvector.hpp"
18#include "qmatrix.hpp"
19
20#include <vector>
21using std::vector;
22
23
24qreal getTestAbsoluteEpsilon();
25qreal getTestRelativeEpsilon();
26
27bool doScalarsAgree(qcomp a, qcomp b);
28bool doMatricesAgree(qmatrix a, qmatrix b);
29
30void REQUIRE_AGREE( Qureg qureg, Qureg other );
31
32void REQUIRE_AGREE( Qureg qureg, qvector reference );
33void REQUIRE_AGREE( Qureg qureg, qmatrix reference );
34
35void REQUIRE_AGREE( qreal scalar, qreal reference );
36void REQUIRE_AGREE( qcomp scalar, qcomp reference );
37
38void REQUIRE_AGREE( vector<qreal> list, vector<qreal> reference );
39void REQUIRE_AGREE( vector<qcomp> list, vector<qcomp> reference );
40
41void REQUIRE_AGREE( qmatrix matrix, qmatrix reference );
42void REQUIRE_AGREE( CompMatr1 matrix, qmatrix reference );
43void REQUIRE_AGREE( CompMatr2 matrix, qmatrix reference );
44void REQUIRE_AGREE( CompMatr matrix, qmatrix reference );
45void REQUIRE_AGREE( DiagMatr1 matrix, qmatrix reference );
46void REQUIRE_AGREE( DiagMatr2 matrix, qmatrix reference );
47void REQUIRE_AGREE( DiagMatr matrix, qmatrix reference );
48void REQUIRE_AGREE( SuperOp matrix, qmatrix reference );
49
50
51#endif // COMPARE_HPP
52
53/** @} (end defgroup) */
Definition qureg.h:49