11# ifndef QUEST_VALIDATION_H
12# define QUEST_VALIDATION_H
21void validateNumRanks(
int numRanks,
const char* caller);
23void validateNumQubitsInQureg(
int numQubits,
int numRanks,
const char* caller);
25void validateNumQubitsInMatrix(
int numQubits,
const char* caller);
27void validateNumQubitsInDiagOp(
int numQubits,
int numRanks,
const char* caller);
29void validateNumQubitsInSubDiagOp(
int numQubits,
const char* caller);
31void validateSubDiagOpTargets(
Qureg qureg,
int* qubits,
int numQubits,
SubDiagonalOp op,
const char* caller);
33void validateUnitarySubDiagOp(
SubDiagonalOp op,
const char* caller);
35void validateAmpIndex(
Qureg qureg,
long long int ampInd,
const char* caller);
37void validateStateIndex(
Qureg qureg,
long long int stateInd,
const char* caller);
39void validateTarget(
Qureg qureg,
int targetQubit,
const char* caller);
41void validateControlTarget(
Qureg qureg,
int controlQubit,
int targetQubit,
const char* caller);
43void validateUniqueTargets(
Qureg qureg,
int qubit1,
int qubit2,
const char* caller);
45void validateMultiQubits(
Qureg qureg,
int* qubits,
int numQubits,
const char* caller);
47void validateMultiTargets(
Qureg qurge,
int* targetQubits,
int numTargetQubits,
const char* caller);
49void validateMultiControls(
Qureg qureg,
int* controlQubits,
int numControlQubits,
const char* caller);
51void validateMultiControlsTarget(
Qureg qureg,
int* controlQubits,
int numControlQubits,
int targetQubit,
const char* caller);
53void validateMultiControlsMultiTargets(
Qureg qureg,
int* controlQubits,
int numControlQubits,
int* targetQubits,
int numTargetQubits,
const char* caller);
55void validateControlState(
int* controlState,
int numControlQubits,
const char* caller);
57void validateOneQubitUnitaryMatrix(
ComplexMatrix2 u,
const char* caller);
61void validateMultiQubitMatrix(
Qureg qureg,
ComplexMatrixN u,
int numTargs,
const char* caller);
63void validateMultiQubitUnitaryMatrix(
Qureg qureg,
ComplexMatrixN u,
int numTargs,
const char* caller);
65void validateMultiQubitMatrixFitsInNode(
Qureg qureg,
int numTargets,
const char* caller);
67void validateUnitaryComplexPair(
Complex alpha,
Complex beta,
const char* caller);
69void validateVector(
Vector vector,
const char* caller);
71void validateStateVecQureg(
Qureg qureg,
const char* caller);
73void validateDensityMatrQureg(
Qureg qureg,
const char* caller);
75void validateOutcome(
int outcome,
const char* caller);
77void validateMeasurementProb(
qreal prob,
const char* caller);
79void validateMatchingQuregDims(
Qureg qureg1,
Qureg qureg2,
const char *caller);
81void validateMatchingQuregTypes(
Qureg qureg1,
Qureg qureg2,
const char *caller);
83void validateSecondQuregStateVec(
Qureg qureg2,
const char *caller);
85void validateNumAmps(
Qureg qureg,
long long int startInd,
long long int numAmps,
const char* caller);
87void validateNumDensityAmps(
Qureg qureg,
long long int startRow,
long long int startCol,
long long int numAmps,
const char* caller);
89void validateFileOpened(
int opened,
char* fn,
const char* caller);
91void validateProb(
qreal prob,
const char* caller);
93void validateNormProbs(
qreal prob1,
qreal prob2,
const char* caller);
95void validateOneQubitDephaseProb(
qreal prob,
const char* caller);
97void validateTwoQubitDephaseProb(
qreal prob,
const char* caller);
99void validateOneQubitDepolProb(
qreal prob,
const char* caller);
101void validateTwoQubitDepolProb(
qreal prob,
const char* caller);
103void validateOneQubitPauliProbs(
qreal probX,
qreal probY,
qreal probZ,
const char* caller);
105void validatePauliCodes(
enum pauliOpType* pauliCodes,
int numPauliCodes,
const char* caller);
107void validateNumPauliSumTerms(
int numTerms,
const char* caller);
111void validateOneQubitKrausMap(
Qureg qureg,
ComplexMatrix2* ops,
int numOps,
const char* caller);
113void validateTwoQubitKrausMap(
Qureg qureg,
ComplexMatrix4* ops,
int numOps,
const char* caller);
115void validateMultiQubitKrausMap(
Qureg qureg,
int numTargs,
ComplexMatrixN* ops,
int numOps,
const char* caller);
117void validateOneQubitKrausMapDimensions(
Qureg qureg,
ComplexMatrix2* ops,
int numOps,
const char* caller);
119void validateTwoQubitKrausMapDimensions(
Qureg qureg,
ComplexMatrix4* ops,
int numOps,
const char* caller);
121void validateMultiQubitKrausMapDimensions(
Qureg qureg,
int numTargs,
ComplexMatrixN* ops,
int numOps,
const char* caller);
123void validateOneQubitDampingProb(
qreal prob,
const char* caller);
125void validateHamilParams(
int numQubits,
int numTerms,
const char* caller);
127void validatePauliHamil(
PauliHamil hamil,
const char* caller);
129void validateMatchingQuregPauliHamilDims(
Qureg qureg,
PauliHamil hamil,
const char* caller);
131void validateHamilFileParams(
int numQubits,
int numTerms, FILE* file,
char* fn,
const char* caller);
133void validateHamilFileCoeffParsed(
int parsed,
PauliHamil h, FILE* file,
char* fn,
const char* caller);
135void validateHamilFilePauliParsed(
int parsed,
PauliHamil h, FILE* file,
char* fn,
const char* caller);
137void validateHamilFilePauliCode(
enum pauliOpType code,
PauliHamil h, FILE* file,
char* fn,
const char* caller);
139void validateTrotterParams(
int order,
int reps,
const char* caller);
141void validateDiagOpInit(
DiagonalOp op,
const char* caller);
143void validateDiagonalOp(
Qureg qureg,
DiagonalOp op,
const char* caller);
147void validateDiagPauliHamilFromFile(
PauliHamil h,
int numRanks,
const char* caller);
149void validateNumElems(
DiagonalOp op,
long long int startInd,
long long int numElems,
const char* caller);
151void validateQubitSubregs(
Qureg qureg,
int* qubits,
int* numQubitsPerReg,
const int numReg,
const char* caller);
153void validatePhaseFuncOverrides(
const int numQubits,
enum bitEncoding encoding,
long long int* overrideInds,
int numOverrides,
const char* caller);
155void validateMultiVarPhaseFuncOverrides(
int* numQubitsPerReg,
const int numRegs,
enum bitEncoding encoding,
long long int* overrideInds,
int numOverrides,
const char* caller);
157void validatePhaseFuncTerms(
int numQubits,
enum bitEncoding encoding,
qreal* coeffs,
qreal* exponents,
int numTerms,
long long int* overrideInds,
int numOverrides,
const char* caller);
159void validateMultiVarPhaseFuncTerms(
int* numQubitsPerReg,
int numRegs,
enum bitEncoding encoding,
qreal* exponents,
int* numTermsPerReg,
const char* caller);
161void validatePhaseFuncName(
enum phaseFunc funcCode,
int numRegs,
int numParams,
const char* caller);
163void validateBitEncoding(
int numQubits,
enum bitEncoding encoding,
const char* caller);
165void validateMultiRegBitEncoding(
int* numQubitsPerReg,
int numRegs,
enum bitEncoding encoding,
const char* caller);
167void validateMemoryAllocationSize(
long long int numAmpsPerRank,
const char* caller);
169void validateQuregAllocation(
Qureg* qureg,
QuESTEnv env,
const char* caller);
171void validateQuregGPUAllocation(
Qureg* qureg,
QuESTEnv env,
const char* caller);
175void validateDiagonalOpGPUAllocation(
DiagonalOp* op,
QuESTEnv env,
const char* caller);
177void validateGPUExists(
int GPUPresent,
const char* caller);
179void validateGPUIsCuQuantumCompatible(
int supportsMemPools,
const char* caller);
181void raiseQASMBufferOverflow(
const char* caller);
pauliOpType
Codes for specifying Pauli operators.
Definition: QuEST.h:113
#define qreal
A precision-agnostic floating point number, as determined by QuEST_PREC.
bitEncoding
Flags for specifying how the bits in sub-register computational basis states are mapped to indices in...
Definition: QuEST.h:288
phaseFunc
Flags for specifying named phase functions.
Definition: QuEST.h:249
Represents a 2x2 matrix of complex numbers.
Definition: QuEST.h:155
Represents a 4x4 matrix of complex numbers.
Definition: QuEST.h:193
Represents a general 2^N by 2^N matrix of complex numbers.
Definition: QuEST.h:204
Represents one complex number.
Definition: QuEST.h:121
Represents a diagonal complex operator on the full Hilbert state of a Qureg.
Definition: QuEST.h:317
A Pauli Hamiltonian, expressed as a real-weighted sum of pauli products, and which can hence represen...
Definition: QuEST.h:297
Information about the environment the program is running in.
Definition: QuEST.h:406
Represents a system of qubits.
Definition: QuEST.h:361
Represents a diagonal complex operator of a smaller dimension than the full Hilbert state of a Qureg.
Definition: QuEST.h:341
Represents a 3-vector of real numbers.
Definition: QuEST.h:216