Skip to content

Commit

Permalink
take two
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonRayJones committed Feb 27, 2025
1 parent 879ccf1 commit 98982a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions tests/utils/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "macros.hpp"
#include "linalg.hpp"
#include "lists.hpp"
#include "random.hpp"
#include "quest/include/quest.h"

#include <vector>
Expand Down Expand Up @@ -122,7 +123,7 @@ vector<qreal> getRandomProbabilities(int numProbs) {
}


auto getRandomCtrlsStatesTargs(int numQubits, int minNumTargs, int maxNumTargsIncl) {
vectortriple getRandomCtrlsStatesTargs(int numQubits, int minNumTargs, int maxNumTargsIncl) {
DEMAND( minNumTargs <= maxNumTargsIncl );
DEMAND( maxNumTargsIncl <= numQubits );

Expand All @@ -138,9 +139,7 @@ auto getRandomCtrlsStatesTargs(int numQubits, int minNumTargs, int maxNumTargsIn
vector<int> ctrls = getSublist(targsCtrls, numTargs, numCtrls);
vector<int> states = getRandomInts(0, 2, numCtrls);

// give a nice, big, ugly explicit type for MSVC
using T = vector<int>;
return tuple<T,T,T>{ctrls,states,targs};
return tuple{ctrls,states,targs};
}


Expand Down
3 changes: 2 additions & 1 deletion tests/utils/random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ int getRandomInt(int min, int maxExcl);
qreal getRandomReal(qreal min, qreal max);
qcomp getRandomComplex();

tuple<vector<int>,vector<int>,vector<int>> getRandomCtrlsStatesTargs(int numQubits, int minNumTargs, int maxNumTargsIncl);
using vectortriple = tuple<vector<int>,vector<int>,vector<int>>;
vectortriple getRandomCtrlsStatesTargs(int numQubits, int minNumTargs, int maxNumTargsIncl);

qvector getRandomVector(size_t dim);
qmatrix getRandomMatrix(size_t dim);
Expand Down

0 comments on commit 98982a7

Please sign in to comment.