The Quantum Exact Simulation Toolkit v4.3.0
Loading...
Searching...
No Matches
cache.hpp
1/** @file
2 * @author Tyson Jones
3 *
4 * @defgroup testutilscache Cache
5 * @ingroup testutils
6 * @brief
7 * Testing utilities which create Quregs across all
8 * available hardware deployments
9 * @{
10 */
11
12#ifndef CACHE_HPP
13#define CACHE_HPP
14
15#include "quest.h"
16
17#include "qvector.hpp"
18#include "qmatrix.hpp"
19
20#include <unordered_map>
21#include <vector>
22#include <string>
23#include <tuple>
24
25using quregCache = std::unordered_map<std::string,Qureg>;
26using matrixCache = std::unordered_map<std::string,FullStateDiagMatr>;
27using deployInfo = std::vector<std::tuple<std::string,int,int,int>>;
28
29
30/*
31 * CUSTOM CACHE
32 *
33 * for obtaining and manually maintaining Quregs of all possible
34 * deployment types, but with the specified dimensions
35 */
36
37quregCache createCustomCachedQuregs(int numQubits, bool isDensityMatrix);
38void destroyCustomCachedQuregs(quregCache& cache);
39
40
41/*
42 * MAIN CACHE
43 *
44 * for obtaining Quregs and FullStateDiagMatrs of all possible
45 * deployment types, managed by the test utils, and with
46 * fixed dimensions specific to the test config
47 */
48
49int getNumCachedQubits();
50deployInfo getSupportedDeployments();
51
52void createCachedFullStateDiagMatrs();
53void destroyCachedFullStateDiagMatrs();
54matrixCache getCachedFullStateDiagMatrs();
55
56void createCachedQuregs();
57void destroyCachedQuregs();
58quregCache getCachedStatevecs();
59quregCache getCachedDensmatrs();
60quregCache getAltCachedStatevecs();
61quregCache getAltCachedDensmatrs();
62
63Qureg getArbitraryCachedStatevec();
64Qureg getArbitraryCachedDensmatr();
65
66
67/*
68 * REFERENCE STATES
69 */
70
71qvector getRefStatevec();
72qmatrix getRefDensmatr();
73
74
75#endif // CACHE_HPP
76
77/** @} (end defgroup) */
Definition qureg.h:49