The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches
lists.hpp
1/** @file
2 * @author Tyson Jones
3 *
4 * @defgroup testutilslists Lists
5 * @ingroup testutils
6 * @brief
7 * Testing utilities which generate lists of integers.
8 * @{
9 */
10
11#ifndef LISTS_HPP
12#define LISTS_HPP
13
14#include <catch2/generators/catch_generators_adapters.hpp>
15
16#include "quest/include/quest.h"
17
18#include <vector>
19#include <tuple>
20
21using std::vector;
22
23using listpair = std::tuple<vector<int>,vector<int>>;
24using listtrio = std::tuple<vector<int>,vector<int>,vector<int>>;
25
26
27vector<int> getRange(int start, int endExcl);
28vector<int> getRange(int endExcl);
29vector<int> getComplement(vector<int> listA, vector<int> listB);
30vector<int> getSublist(vector<int> list, int start, int len);
31vector<qcomp> getSublist(vector<qcomp> list, int start, int len);
32
33
34template<class T> using CatchGen = Catch::Generators::GeneratorWrapper<T>;
35CatchGen<vector<int>> sublists(CatchGen<int>&& gen, int sublen);
36CatchGen<listpair> disjointsublists(CatchGen<int>&& gen, int sublen1, int sublen2);
37
38
39vector<int> GENERATE_TARGS(int numQubits, int numTargs);
40listpair GENERATE_CTRLS_AND_TARGS(int numQubits, int numCtrls, int numTargs);
41
42
43#endif // LISTS_HPP
44
45/** @} (end defgroup) */