QuEST_validation.c
Go to the documentation of this file.
1 // Distributed under MIT licence. See https://github.com/QuEST-Kit/QuEST/blob/master/LICENCE.txt for details
117 [E_INVALID_NUM_RANKS] = "Invalid number of nodes. Distributed simulation can only make use of a power-of-2 number of node.",
127 [E_INVALID_OFFSET_NUM_AMPS_QUREG] = "More amplitudes given than exist in the statevector from the given starting index.",
128 [E_INVALID_OFFSET_NUM_ELEMS_DIAG] = "More elements given than exist in the diagonal operator from the given starting index.",
139 [E_NON_UNITARY_COMPLEX_PAIR] = "Compact matrix formed by given complex numbers is not unitary.",
141 [E_SYS_TOO_BIG_TO_PRINT] = "Invalid system size. Cannot print output for systems greater than 5 qubits.",
147 [E_MISMATCHING_QUREG_TYPES] = "Registers must both be state-vectors or both be density matrices.",
152 [E_INVALID_ONE_QUBIT_DEPHASE_PROB] = "The probability of a single qubit dephase error cannot exceed 1/2, which maximally mixes.",
153 [E_INVALID_TWO_QUBIT_DEPHASE_PROB] = "The probability of a two-qubit qubit dephase error cannot exceed 3/4, which maximally mixes.",
154 [E_INVALID_ONE_QUBIT_DEPOL_PROB] = "The probability of a single qubit depolarising error cannot exceed 3/4, which maximally mixes.",
155 [E_INVALID_TWO_QUBIT_DEPOL_PROB] = "The probability of a two-qubit depolarising error cannot exceed 15/16, which maximally mixes.",
156 [E_INVALID_ONE_QUBIT_PAULI_PROBS] = "The probability of any X, Y or Z error cannot exceed the probability of no error.",
157 [E_INVALID_CONTROLS_BIT_STATE] = "The state of the control qubits must be a bit sequence (0s and 1s).",
158 [E_INVALID_PAULI_CODE] = "Invalid Pauli code. Codes must be 0 (or PAULI_I), 1 (PAULI_X), 2 (PAULI_Y) or 3 (PAULI_Z) to indicate the identity, X, Y and Z operators respectively.",
159 [E_INVALID_NUM_SUM_TERMS] = "Invalid number of terms in the Pauli sum. The number of terms must be >0.",
160 [E_CANNOT_FIT_MULTI_QUBIT_MATRIX] = "The specified matrix targets too many qubits; the batches of amplitudes to modify cannot all fit in a single distributed node's memory allocation.",
162 [E_COMPLEX_MATRIX_NOT_INIT] = "The ComplexMatrixN was not successfully created (possibly insufficient memory available).",
163 [E_INVALID_NUM_ONE_QUBIT_KRAUS_OPS] = "At least 1 and at most 4 single qubit Kraus operators may be specified.",
164 [E_INVALID_NUM_TWO_QUBIT_KRAUS_OPS] = "At least 1 and at most 16 two-qubit Kraus operators may be specified.",
165 [E_INVALID_NUM_N_QUBIT_KRAUS_OPS] = "At least 1 and at most 4*N^2 of N-qubit Kraus operators may be specified.",
166 [E_INVALID_KRAUS_OPS] = "The specified Kraus map is not a completely positive, trace preserving map.",
167 [E_MISMATCHING_NUM_TARGS_KRAUS_SIZE] = "Every Kraus operator must be of the same number of qubits as the number of targets.",
168 [E_DISTRIB_QUREG_TOO_SMALL] = "Too few qubits. The created qureg must have at least one amplitude per node used in distributed simulation.",
169 [E_DISTRIB_DIAG_OP_TOO_SMALL] = "Too few qubits. The created DiagonalOp must contain at least one element per node used in distributed simulation.",
170 [E_NUM_AMPS_EXCEED_TYPE] = "Too many qubits (max of log2(SIZE_MAX)). Cannot store the number of amplitudes per-node in the size_t type.",
171 [E_INVALID_PAULI_HAMIL_PARAMS] = "The number of qubits and terms in the PauliHamil must be strictly positive.",
172 [E_INVALID_PAULI_HAMIL_FILE_PARAMS] = "The number of qubits and terms in the PauliHamil file (%s) must be strictly positive.",
173 [E_CANNOT_PARSE_PAULI_HAMIL_FILE_COEFF] = "Failed to parse the next expected term coefficient in PauliHamil file (%s).",
174 [E_CANNOT_PARSE_PAULI_HAMIL_FILE_PAULI] = "Failed to parse the next expected Pauli code in PauliHamil file (%s).",
175 [E_INVALID_PAULI_HAMIL_FILE_PAULI_CODE] = "The PauliHamil file (%s) contained an invalid pauli code (%d). Codes must be 0 (or PAULI_I), 1 (PAULI_X), 2 (PAULI_Y) or 3 (PAULI_Z) to indicate the identity, X, Y and Z operators respectively.",
176 [E_MISMATCHING_PAULI_HAMIL_QUREG_NUM_QUBITS] = "The PauliHamil must act on the same number of qubits as exist in the Qureg.",
177 [E_INVALID_TROTTER_ORDER] = "The Trotterisation order must be 1, or an even number (for higher-order Suzuki symmetrized expansions).",
179 [E_MISMATCHING_QUREG_DIAGONAL_OP_SIZE] = "The qureg must represent an equal number of qubits as that in the applied diagonal operator.",
180 [E_DIAGONAL_OP_NOT_INITIALISED] = "The diagonal operator has not been initialised through createDiagonalOperator().",
181 [E_PAULI_HAMIL_NOT_DIAGONAL] = "The Pauli Hamiltonian contained operators other than PAULI_Z and PAULI_I, and hence cannot be expressed as a diagonal matrix.",
182 [E_MISMATCHING_PAULI_HAMIL_DIAGONAL_OP_SIZE] = "The Pauli Hamiltonian and diagonal operator have different, incompatible dimensions.",
183 [E_INVALID_NUM_SUBREGISTERS] = "Invalid number of qubit subregisters, which must be >0 and <=100.",
184 [E_INVALID_NUM_PHASE_FUNC_TERMS] = "Invalid number of terms in the phase function specified. Must be >0.",
185 [E_INVALID_NUM_PHASE_FUNC_OVERRIDES] = "Invalid number of phase function overrides specified. Must be >=0, and for single-variable phase functions, <=2^numQubits (the maximum unique binary values of the sub-register). Note that uniqueness of overriding indices is not checked.",
186 [E_INVALID_PHASE_FUNC_OVERRIDE_UNSIGNED_INDEX] = "Invalid phase function override index, in the UNSIGNED encoding. Must be >=0, and <= the maximum index possible of the corresponding qubit subregister (2^numQubits-1).",
187 [E_INVALID_PHASE_FUNC_OVERRIDE_TWOS_COMPLEMENT_INDEX] = "Invalid phase function override index, in the TWOS_COMPLEMENT encoding. Must be between (inclusive) -2^(N-1) and +2^(N-1)-1, where N is the number of qubits (including the sign qubit).",
188 [E_INVALID_PHASE_FUNC_NAME] = "Invalid named phase function, which must be one of {NORM, SCALED_NORM, INVERSE_NORM, SCALED_INVERSE_NORM, PRODUCT, SCALED_PRODUCT, INVERSE_PRODUCT, SCALED_INVERSE_PRODUCT, DISTANCE, SCALED_DISTANCE, INVERSE_DISTANCE, SCALED_INVERSE_DISTANCE}.",
189 [E_INVALID_NUM_NAMED_PHASE_FUNC_PARAMS] = "Invalid number of parameters passed for the given named phase function. {NORM, PRODUCT, DISTANCE} accept 0 parameters, {INVERSE_NORM, INVERSE_PRODUCT, INVERSE_DISTANCE} accept 1 parameter (the phase at the divergence), {SCALED_NORM, SCALED_INVERSE_NORM, SCALED_PRODUCT} accept 1 parameter (the scaling coefficient), {SCALED_INVERSE_PRODUCT, SCALED_DISTANCE, SCALED_INVERSE_DISTANCE} accept 2 parameters (the coefficient then divergence phase), SCALED_INVERSE_SHIFTED_NORM accepts 2 + (number of sub-registers) parameters (the coefficient, then the divergence phase, followed by the offset for each sub-register), SCALED_INVERSE_SHIFTED_DISTANCE accepts 2 + (number of sub-registers) / 2 parameters (the coefficient, then the divergence phase, followed by the offset for each pair of sub-registers).",
191 [E_INVALID_NUM_QUBITS_TWOS_COMPLEMENT] = "A sub-register contained too few qubits to employ TWOS_COMPLEMENT encoding. Must use >1 qubits (allocating one for the sign).",
192 [E_NEGATIVE_EXPONENT_WITHOUT_ZERO_OVERRIDE] = "The phase function contained a negative exponent which would diverge at zero, but the zero index was not overriden.",
193 [E_FRACTIONAL_EXPONENT_WITHOUT_NEG_OVERRIDE] = "The phase function contained a fractional exponent, which in TWOS_COMPLEMENT encoding, requires all negative indices are overriden. However, one or more negative indices were not overriden.",
194 [E_NEGATIVE_EXPONENT_MULTI_VAR] = "The phase function contained an illegal negative exponent. One must instead call applyPhaseFuncOverrides() once for each register, so that the zero index of each register is overriden, independent of the indices of all other registers.",
195 [E_FRACTIONAL_EXPONENT_MULTI_VAR] = "The phase function contained a fractional exponent, which is illegal in TWOS_COMPLEMENT encoding, since it cannot be (efficiently) checked that all negative indices were overriden. One must instead call applyPhaseFuncOverrides() once for each register, so that each register's negative indices can be overriden, independent of the indices of all other registers.",
196 [E_INVALID_NUM_REGS_DISTANCE_PHASE_FUNC] = "Phase functions DISTANCE, INVERSE_DISTANCE, SCALED_DISTANCE and SCALED_INVERSE_DISTANCE require a strictly even number of sub-registers."
387 void validateNumAmps(Qureg qureg, long long int startInd, long long int numAmps, const char* caller) {
393 void validateNumElems(DiagonalOp op, long long int startInd, long long int numElems, const char* caller) {
401 QuESTAssert(targetQubit>=0 && targetQubit<qureg.numQubitsRepresented, E_INVALID_TARGET_QUBIT, caller);
405 QuESTAssert(controlQubit>=0 && controlQubit<qureg.numQubitsRepresented, E_INVALID_CONTROL_QUBIT, caller);
408 void validateControlTarget(Qureg qureg, int controlQubit, int targetQubit, const char* caller) {
421 QuESTAssert(numTargetQubits>0 && numTargetQubits<=qureg.numQubitsRepresented, E_INVALID_NUM_TARGETS, caller);
425 QuESTAssert(numControlQubits>0 && numControlQubits<qureg.numQubitsRepresented, E_INVALID_NUM_CONTROLS, caller);
428 void validateMultiTargets(Qureg qureg, int* targetQubits, int numTargetQubits, const char* caller) {
436 void validateMultiControls(Qureg qureg, int* controlQubits, int numControlQubits, const char* caller) {
445 QuESTAssert(numQubits>0 && numQubits<=qureg.numQubitsRepresented, E_INVALID_NUM_QUBITS, caller);
447 QuESTAssert(qubits[i]>=0 && qubits[i]<qureg.numQubitsRepresented, E_INVALID_QUBIT_INDEX, caller);
452 void validateMultiControlsTarget(Qureg qureg, int* controlQubits, int numControlQubits, int targetQubit, const char* caller) {
459 void validateMultiControlsMultiTargets(Qureg qureg, int* controlQubits, int numControlQubits, int* targetQubits, int numTargetQubits, const char* caller) {
470 QuESTAssert(controlState[i] == 0 || controlState[i] == 1, E_INVALID_CONTROLS_BIT_STATE, caller);
474 QuESTAssert(qureg.numAmpsPerChunk >= (1LL << numTargets), E_CANNOT_FIT_MULTI_QUBIT_MATRIX, caller);
496 void validateMultiQubitMatrix(Qureg qureg, ComplexMatrixN u, int numTargs, const char* caller) {
502 void validateMultiQubitUnitaryMatrix(Qureg qureg, ComplexMatrixN u, int numTargs, const char* caller) {
532 QuESTAssert(qureg1.numQubitsRepresented==qureg2.numQubitsRepresented, E_MISMATCHING_QUREG_DIMENSIONS, caller);
610 void validateOneQubitKrausMap(Qureg qureg, ComplexMatrix2* ops, int numOps, const char* caller) {
622 void validateTwoQubitKrausMap(Qureg qureg, ComplexMatrix4* ops, int numOps, const char* caller) {
634 void validateMultiQubitKrausMap(Qureg qureg, int numTargs, ComplexMatrixN* ops, int numOps, const char* caller) {
661 QuESTAssert(hamil.numQubits == qureg.numQubitsRepresented, E_MISMATCHING_PAULI_HAMIL_QUREG_NUM_QUBITS, caller);
664 void validateHamilFileParams(int numQubits, int numTerms, FILE* file, char* fn, const char* caller) {
673 void validateHamilFileCoeffParsed(int parsed, PauliHamil h, FILE* file, char* fn, const char* caller) {
683 void validateHamilFilePauliParsed(int parsed, PauliHamil h, FILE* file, char* fn, const char* caller) {
693 void validateHamilFilePauliCode(enum pauliOpType code, PauliHamil h, FILE* file, char* fn, const char* caller) {
715 QuESTAssert(qureg.numQubitsRepresented == op.numQubits, E_MISMATCHING_QUREG_DIAGONAL_OP_SIZE, caller);
719 QuESTAssert(op.numQubits == hamil.numQubits, E_MISMATCHING_PAULI_HAMIL_DIAGONAL_OP_SIZE, caller);
757 void validateQubitSubregs(Qureg qureg, int* qubits, int* numQubitsPerReg, const int numRegs, const char* caller) {
758 QuESTAssert(numRegs>0 && numRegs<=MAX_NUM_REGS_APPLY_ARBITRARY_PHASE, E_INVALID_NUM_SUBREGISTERS, caller);
762 QuESTAssert(numQubitsPerReg[r]>0 && numQubitsPerReg[r]<=qureg.numQubitsRepresented, E_INVALID_NUM_QUBITS, caller);
765 QuESTAssert(qubits[i]>=0 && qubits[i]<qureg.numQubitsRepresented, E_INVALID_QUBIT_INDEX, caller);
773 void validatePhaseFuncTerms(int numQubits, enum bitEncoding encoding, qreal* coeffs, qreal* exponents, int numTerms, long long int* overrideInds, int numOverrides, const char* caller) {
836 void validateMultiVarPhaseFuncTerms(int* numQubitsPerReg, int numRegs, enum bitEncoding encoding, qreal* exponents, int* numTermsPerReg, const char* caller) {
837 QuESTAssert(numRegs>0 && numRegs<=MAX_NUM_REGS_APPLY_ARBITRARY_PHASE, E_INVALID_NUM_SUBREGISTERS, caller);
862 void validatePhaseFuncOverrides(const int numQubits, enum bitEncoding encoding, long long int* overrideInds, int numOverrides, const char* caller) {
873 QuESTAssert(overrideInds[v]>=minInd && overrideInds[v]<=maxInd, E_INVALID_PHASE_FUNC_OVERRIDE_UNSIGNED_INDEX, caller);
881 QuESTAssert(overrideInds[v]>=minInd && overrideInds[v]<=maxInd, E_INVALID_PHASE_FUNC_OVERRIDE_TWOS_COMPLEMENT_INDEX, caller);
886 void validateMultiVarPhaseFuncOverrides(int* numQubitsPerReg, const int numRegs, enum bitEncoding encoding, long long int* overrideInds, int numOverrides, const char* caller) {
894 QuESTAssert(overrideInds[i]>=0 && overrideInds[i]<=maxInd, E_INVALID_PHASE_FUNC_OVERRIDE_UNSIGNED_INDEX, caller);
906 QuESTAssert(overrideInds[i]>=minInd && overrideInds[i]<=maxInd, E_INVALID_PHASE_FUNC_OVERRIDE_TWOS_COMPLEMENT_INDEX, caller);
913 void validatePhaseFuncName(enum phaseFunc funcCode, int numRegs, int numParams, const char* caller) {
976 void validateMultiRegBitEncoding(int* numQubitsPerReg, int numRegs, enum bitEncoding encoding, const char* caller) {
void validateDensityMatrQureg(Qureg qureg, const char *caller)
Definition: QuEST_validation.c:519
void validateMultiControlsTarget(Qureg qureg, int *controlQubits, int numControlQubits, int targetQubit, const char *caller)
Definition: QuEST_validation.c:452
void validateMeasurementProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:527
void validateTarget(Qureg qureg, int targetQubit, const char *caller)
Definition: QuEST_validation.c:400
@ E_MISMATCHING_PAULI_HAMIL_DIAGONAL_OP_SIZE
Definition: QuEST_validation.c:99
void validateBitEncoding(int numQubits, enum bitEncoding encoding, const char *caller)
Definition: QuEST_validation.c:966
void validateMultiRegBitEncoding(int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, const char *caller)
Definition: QuEST_validation.c:976
void validateOutcome(int outcome, const char *caller)
Definition: QuEST_validation.c:523
@ E_CANNOT_PARSE_PAULI_HAMIL_FILE_COEFF
Definition: QuEST_validation.c:90
void validateMultiVarPhaseFuncOverrides(int *numQubitsPerReg, const int numRegs, enum bitEncoding encoding, long long int *overrideInds, int numOverrides, const char *caller)
Definition: QuEST_validation.c:886
void validateHamilFileCoeffParsed(int parsed, PauliHamil h, FILE *file, char *fn, const char *caller)
Definition: QuEST_validation.c:673
void validateStateIndex(Qureg qureg, long long int stateInd, const char *caller)
Definition: QuEST_validation.c:377
void validateHamilParams(int numQubits, int numTerms, const char *caller)
Definition: QuEST_validation.c:651
void validateStateVecQureg(Qureg qureg, const char *caller)
Definition: QuEST_validation.c:515
void validateMultiQubitMatrixFitsInNode(Qureg qureg, int numTargets, const char *caller)
Definition: QuEST_validation.c:473
@ E_INVALID_NUM_REGS_DISTANCE_PHASE_FUNC
Definition: QuEST_validation.c:113
void validateNumAmps(Qureg qureg, long long int startInd, long long int numAmps, const char *caller)
Definition: QuEST_validation.c:387
void validateNumQubitsInQureg(int numQubits, int numRanks, const char *caller)
Definition: QuEST_validation.c:349
void validateMultiQubitUnitaryMatrix(Qureg qureg, ComplexMatrixN u, int numTargs, const char *caller)
Definition: QuEST_validation.c:502
void validateHamilFilePauliParsed(int parsed, PauliHamil h, FILE *file, char *fn, const char *caller)
Definition: QuEST_validation.c:683
void validateNumControls(Qureg qureg, int numControlQubits, const char *caller)
Definition: QuEST_validation.c:424
int isCompletelyPositiveMap4(ComplexMatrix4 *ops, int numOps)
Definition: QuEST_validation.c:303
@ E_CANNOT_PARSE_PAULI_HAMIL_FILE_PAULI
Definition: QuEST_validation.c:91
#define macro_isCompletelyPositiveMap(ops, numOps, opDim)
Definition: QuEST_validation.c:282
void validateHamilFilePauliCode(enum pauliOpType code, PauliHamil h, FILE *file, char *fn, const char *caller)
Definition: QuEST_validation.c:693
void validateMultiVarPhaseFuncTerms(int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, qreal *exponents, int *numTermsPerReg, const char *caller)
Definition: QuEST_validation.c:836
void validatePhaseFuncOverrides(const int numQubits, enum bitEncoding encoding, long long int *overrideInds, int numOverrides, const char *caller)
Definition: QuEST_validation.c:862
@ E_INVALID_NUM_TWO_QUBIT_KRAUS_OPS
Definition: QuEST_validation.c:81
void validateTwoQubitDepolProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:583
void validateNumPauliSumTerms(int numTerms, const char *caller)
Definition: QuEST_validation.c:606
#define qreal
void validateMatrixInit(ComplexMatrixN matr, const char *caller)
Definition: QuEST_validation.c:486
void validateFileOpened(int opened, char *fn, const char *caller)
Definition: QuEST_validation.c:543
int isCompletelyPositiveMap2(ComplexMatrix2 *ops, int numOps)
Definition: QuEST_validation.c:300
@ E_INVALID_PAULI_HAMIL_FILE_PAULI_CODE
Definition: QuEST_validation.c:92
unsigned int calcLog2(long unsigned int num)
returns log2 of numbers which must be gauranteed to be 2^n
Definition: QuEST_validation.c:328
void validateControl(Qureg qureg, int controlQubit, const char *caller)
Definition: QuEST_validation.c:404
#define macro_isMatrixUnitary(m, dim, retVal)
Definition: QuEST_validation.c:236
void validateNumTargets(Qureg qureg, int numTargetQubits, const char *caller)
Definition: QuEST_validation.c:420
@ E_INVALID_PHASE_FUNC_OVERRIDE_TWOS_COMPLEMENT_INDEX
Definition: QuEST_validation.c:104
void validateMultiQubits(Qureg qureg, int *qubits, int numQubits, const char *caller)
Definition: QuEST_validation.c:444
void invalidQuESTInputError(const char *errMsg, const char *errFunc)
An internal function called when invalid arguments are passed to a QuEST API call,...
Definition: QuEST_validation.c:209
void validateControlTarget(Qureg qureg, int controlQubit, int targetQubit, const char *caller)
Definition: QuEST_validation.c:408
void validateDiagonalOp(Qureg qureg, DiagonalOp op, const char *caller)
Definition: QuEST_validation.c:713
long long int numAmpsPerChunk
Number of probability amplitudes held in stateVec by this process In the non-MPI version,...
Definition: QuEST.h:332
void validateOneQubitDephaseProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:563
enum pauliOpType * pauliCodes
The Pauli operators acting on each qubit, flattened over every operator.
Definition: QuEST.h:281
@ E_MISMATCHING_NUM_TARGS_KRAUS_SIZE
Definition: QuEST_validation.c:84
void validateControlState(int *controlState, int numControlQubits, const char *caller)
Definition: QuEST_validation.c:468
void validateMultiTargets(Qureg qureg, int *targetQubits, int numTargetQubits, const char *caller)
Definition: QuEST_validation.c:428
#define MAX_NUM_REGS_APPLY_ARBITRARY_PHASE
Definition: QuEST_precision.h:72
void validateMatchingQuregDims(Qureg qureg1, Qureg qureg2, const char *caller)
Definition: QuEST_validation.c:531
int numQubits
The number of qubits this operator can act on (informing its size)
Definition: QuEST.h:300
@ E_INVALID_NUM_ONE_QUBIT_KRAUS_OPS
Definition: QuEST_validation.c:80
int numSumTerms
The number of terms in the weighted sum, or the number of Pauli products.
Definition: QuEST.h:285
long long int getQubitBitMask(int *qubits, int numQubits)
Definition: QuEST_common.c:50
@ E_MISMATCHING_QUREG_DIAGONAL_OP_SIZE
Definition: QuEST_validation.c:96
Represents a diagonal complex operator on the full Hilbert state of a Qureg.
Definition: QuEST.h:297
A Pauli Hamiltonian, expressed as a real-weighted sum of pauli products, and which can hence represen...
Definition: QuEST.h:277
void validateNumElems(DiagonalOp op, long long int startInd, long long int numElems, const char *caller)
Definition: QuEST_validation.c:393
void validateOneQubitKrausMap(Qureg qureg, ComplexMatrix2 *ops, int numOps, const char *caller)
Definition: QuEST_validation.c:610
void validateQubitSubregs(Qureg qureg, int *qubits, int *numQubitsPerReg, const int numRegs, const char *caller)
Definition: QuEST_validation.c:757
@ E_MISMATCHING_PAULI_HAMIL_QUREG_NUM_QUBITS
Definition: QuEST_validation.c:93
void QuESTAssert(int isValid, ErrorCode code, const char *func)
Definition: QuEST_validation.c:216
void validateDiagPauliHamil(DiagonalOp op, PauliHamil hamil, const char *caller)
Definition: QuEST_validation.c:718
void validateOneQubitDepolProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:573
void validateTwoQubitKrausMap(Qureg qureg, ComplexMatrix4 *ops, int numOps, const char *caller)
Definition: QuEST_validation.c:622
void validateDiagPauliHamilFromFile(PauliHamil hamil, int numRanks, const char *caller)
Definition: QuEST_validation.c:727
void validateNumQubitsInMatrix(int numQubits, const char *caller)
Definition: QuEST_validation.c:361
void validatePhaseFuncName(enum phaseFunc funcCode, int numRegs, int numParams, const char *caller)
Definition: QuEST_validation.c:913
void validatePauliHamil(PauliHamil hamil, const char *caller)
Definition: QuEST_validation.c:655
void validateTwoQubitUnitaryMatrix(Qureg qureg, ComplexMatrix4 u, const char *caller)
Definition: QuEST_validation.c:481
void validateDiagOpInit(DiagonalOp op, const char *caller)
Definition: QuEST_validation.c:709
@ E_INVALID_NUM_NAMED_PHASE_FUNC_PARAMS
Definition: QuEST_validation.c:106
void validateMatchingQuregPauliHamilDims(Qureg qureg, PauliHamil hamil, const char *caller)
Definition: QuEST_validation.c:660
void validateMatchingQuregTypes(Qureg qureg1, Qureg qureg2, const char *caller)
Definition: QuEST_validation.c:535
void validateAmpIndex(Qureg qureg, long long int ampInd, const char *caller)
Definition: QuEST_validation.c:382
void validateHamilFileParams(int numQubits, int numTerms, FILE *file, char *fn, const char *caller)
Definition: QuEST_validation.c:664
void validateOneQubitUnitaryMatrix(ComplexMatrix2 u, const char *caller)
Definition: QuEST_validation.c:477
@ E_INVALID_PAULI_HAMIL_FILE_PARAMS
Definition: QuEST_validation.c:89
void validateSecondQuregStateVec(Qureg qureg2, const char *caller)
Definition: QuEST_validation.c:539
int numQubits
The number of qubits informing the Hilbert dimension of the Hamiltonian.
Definition: QuEST.h:287
int numQubitsRepresented
The number of qubits represented in either the state-vector or density matrix.
Definition: QuEST.h:327
@ E_INVALID_NUM_PHASE_FUNC_OVERRIDES
Definition: QuEST_validation.c:102
@ E_INVALID_PHASE_FUNC_OVERRIDE_UNSIGNED_INDEX
Definition: QuEST_validation.c:103
long long int numAmpsTotal
Total number of amplitudes, which are possibly distributed among machines.
Definition: QuEST.h:334
void validateMultiControlsMultiTargets(Qureg qureg, int *controlQubits, int numControlQubits, int *targetQubits, int numTargetQubits, const char *caller)
Definition: QuEST_validation.c:459
void validatePhaseFuncTerms(int numQubits, enum bitEncoding encoding, qreal *coeffs, qreal *exponents, int numTerms, long long int *overrideInds, int numOverrides, const char *caller)
Definition: QuEST_validation.c:773
@ E_INVALID_NUM_QUBITS_TWOS_COMPLEMENT
Definition: QuEST_validation.c:108
void destroyPauliHamil(PauliHamil h)
Destroy a PauliHamil instance, created with either createPauliHamil() or createPauliHamilFromFile().
Definition: QuEST.c:1414
int isCompletelyPositiveMapN(ComplexMatrixN *ops, int numOps)
Definition: QuEST_validation.c:306
void validateMultiControls(Qureg qureg, int *controlQubits, int numControlQubits, const char *caller)
Definition: QuEST_validation.c:436
void validateMultiQubitKrausMap(Qureg qureg, int numTargs, ComplexMatrixN *ops, int numOps, const char *caller)
Definition: QuEST_validation.c:634
void validateMultiQubitMatrix(Qureg qureg, ComplexMatrixN u, int numTargs, const char *caller)
Definition: QuEST_validation.c:496
void validateNumQubitsInDiagOp(int numQubits, int numRanks, const char *caller)
Definition: QuEST_validation.c:365
@ E_NEGATIVE_EXPONENT_WITHOUT_ZERO_OVERRIDE
Definition: QuEST_validation.c:109
void validateNumRanks(int numRanks, const char *caller)
Definition: QuEST_validation.c:335
void validateTrotterParams(int order, int reps, const char *caller)
Definition: QuEST_validation.c:703
int isComplexPairUnitary(Complex alpha, Complex beta)
Definition: QuEST_validation.c:228
void validatePauliCodes(enum pauliOpType *pauliCodes, int numPauliCodes, const char *caller)
Definition: QuEST_validation.c:599
void validateUnitaryComplexPair(Complex alpha, Complex beta, const char *caller)
Definition: QuEST_validation.c:507
void validateNormProbs(qreal prob1, qreal prob2, const char *caller)
Definition: QuEST_validation.c:555
void validateOneQubitDampingProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:578
void default_invalidQuESTInputError(const char *errMsg, const char *errFunc)
Definition: QuEST_validation.c:199
@ E_FRACTIONAL_EXPONENT_WITHOUT_NEG_OVERRIDE
Definition: QuEST_validation.c:110
void validateUniqueTargets(Qureg qureg, int qubit1, int qubit2, const char *caller)
Definition: QuEST_validation.c:414
bitEncoding
Flags for specifying how the bits in sub-register computational basis states are mapped to indices in...
Definition: QuEST.h:269
void validateTwoQubitDephaseProb(qreal prob, const char *caller)
Definition: QuEST_validation.c:568
void validateOneQubitPauliProbs(qreal probX, qreal probY, qreal probZ, const char *caller)
Definition: QuEST_validation.c:588