The Quantum Exact Simulation Toolkit v4.3.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.h"
17#include "qvector.hpp"
18#include "qmatrix.hpp"
19
20#include <vector>
21using std::vector;
22
23
24qreal getTestAbsoluteEpsilon();
25qreal getTestRelativeEpsilon();
26
27void setTestAbsoluteEpsilon(qreal eps);
28void setTestRelativeEpsilon(qreal eps);
29void setTestEpsilon(qreal eps); // sets both abs and rel
30
31bool doScalarsAgree(qcomp a, qcomp b);
32bool doMatricesAgree(qmatrix a, qmatrix b);
33
34void REQUIRE_AGREE( Qureg qureg, Qureg other );
35
36void REQUIRE_AGREE( Qureg qureg, qvector reference );
37void REQUIRE_AGREE( Qureg qureg, qmatrix reference );
38
39void REQUIRE_AGREE( qreal scalar, qreal reference );
40void REQUIRE_AGREE( qcomp scalar, qcomp reference );
41
42void REQUIRE_AGREE( vector<qreal> list, vector<qreal> reference );
43void REQUIRE_AGREE( vector<qcomp> list, vector<qcomp> reference );
44
45void REQUIRE_AGREE( qmatrix matrix, qmatrix reference );
46void REQUIRE_AGREE( CompMatr1 matrix, qmatrix reference );
47void REQUIRE_AGREE( CompMatr2 matrix, qmatrix reference );
48void REQUIRE_AGREE( CompMatr matrix, qmatrix reference );
49void REQUIRE_AGREE( DiagMatr1 matrix, qmatrix reference );
50void REQUIRE_AGREE( DiagMatr2 matrix, qmatrix reference );
51void REQUIRE_AGREE( DiagMatr matrix, qmatrix reference );
52void REQUIRE_AGREE( SuperOp matrix, qmatrix reference );
53
54
55#endif // COMPARE_HPP
56
57/** @} (end defgroup) */
Definition qureg.h:49