Go to the source code of this file.
Functions | |
| void | conjugateMatrixN (ComplexMatrixN u) |
| qreal | densmatr_calcFidelity (Qureg qureg, Qureg pureState) |
| qreal | densmatr_calcHilbertSchmidtDistance (Qureg a, Qureg b) |
| qreal | densmatr_calcInnerProduct (Qureg a, Qureg b) |
| qreal | densmatr_calcProbOfOutcome (Qureg qureg, const int measureQubit, int outcome) |
| qreal | densmatr_calcPurity (Qureg qureg) |
| Computes the trace of the density matrix squared. More... | |
| qreal | densmatr_calcTotalProb (Qureg qureg) |
| void | densmatr_collapseToKnownProbOutcome (Qureg qureg, const int measureQubit, int outcome, qreal outcomeProb) |
| Renorms (/prob) every | * outcome * >< * outcome * | state, setting all others to zero. More... | |
| void | densmatr_initClassicalState (Qureg qureg, long long int stateInd) |
| void | densmatr_initPlusState (Qureg targetQureg) |
| void | densmatr_initPureState (Qureg targetQureg, Qureg copyQureg) |
| int | densmatr_measureWithStats (Qureg qureg, int measureQubit, qreal *outcomeProb) |
| void | densmatr_mixDamping (Qureg qureg, const int targetQubit, qreal damping) |
| void | densmatr_mixDensityMatrix (Qureg combineQureg, qreal otherProb, Qureg otherQureg) |
| void | densmatr_mixDephasing (Qureg qureg, const int targetQubit, qreal dephase) |
| void | densmatr_mixDepolarising (Qureg qureg, const int targetQubit, qreal depolLevel) |
| void | densmatr_mixKrausMap (Qureg qureg, int target, ComplexMatrix2 *ops, int numOps) |
| void | densmatr_mixMultiQubitKrausMap (Qureg qureg, int *targets, int numTargets, ComplexMatrixN *ops, int numOps) |
| void | densmatr_mixPauli (Qureg qureg, int qubit, qreal pX, qreal pY, qreal pZ) |
| void | densmatr_mixTwoQubitDephasing (Qureg qureg, const int qubit1, const int qubit2, qreal dephase) |
| void | densmatr_mixTwoQubitDepolarising (Qureg qureg, int qubit1, int qubit2, qreal depolLevel) |
| void | densmatr_mixTwoQubitKrausMap (Qureg qureg, int target1, int target2, ComplexMatrix4 *ops, int numOps) |
| void | ensureIndsIncrease (int *ind1, int *ind2) |
| void | getComplexPairAndPhaseFromUnitary (ComplexMatrix2 u, Complex *alpha, Complex *beta, qreal *globalPhase) |
| maps U(r0c0, r0c1, r1c0, r1c1) to exp(i globalPhase) U(alpha, beta) More... | |
| void | getComplexPairFromRotation (qreal angle, Vector axis, Complex *alpha, Complex *beta) |
| ComplexMatrix2 | getConjugateMatrix2 (ComplexMatrix2 src) |
| ComplexMatrix4 | getConjugateMatrix4 (ComplexMatrix4 src) |
| Complex | getConjugateScalar (Complex scalar) |
| long long int | getControlFlipMask (int *controlQubits, int *controlState, const int numControlQubits) |
| long long int | getQubitBitMask (int *controlQubits, const int numControlQubits) |
| void | getQuESTDefaultSeedKey (unsigned long int *key) |
| qreal | getVectorMagnitude (Vector vec) |
| void | getZYZRotAnglesFromComplexPair (Complex alpha, Complex beta, qreal *rz2, qreal *ry, qreal *rz1) |
| maps U(alpha, beta) to Rz(rz2) Ry(ry) Rz(rz1) More... | |
| unsigned long int | hashString (char *str) |
| void | setConjugateMatrixN (ComplexMatrixN m) |
| void | shiftIndices (int *indices, int numIndices, int shift) |
| void | statevec_applyPauliSum (Qureg inQureg, enum pauliOpType *allCodes, qreal *termCoeffs, int numSumTerms, Qureg outQureg) |
| qreal | statevec_calcExpecPauliProd (Qureg qureg, int *targetQubits, enum pauliOpType *pauliCodes, int numTargets, Qureg workspace) |
| qreal | statevec_calcExpecPauliSum (Qureg qureg, enum pauliOpType *allCodes, qreal *termCoeffs, int numSumTerms, Qureg workspace) |
| qreal | statevec_calcFidelity (Qureg qureg, Qureg pureState) |
| Complex | statevec_calcInnerProduct (Qureg bra, Qureg ket) |
| Terrible code which unnecessarily individually computes and sums the real and imaginary components of the inner product, so as to not have to worry about keeping the sums separated during reduction. More... | |
| qreal | statevec_calcProbOfOutcome (Qureg qureg, const int measureQubit, int outcome) |
| qreal | statevec_calcTotalProb (Qureg qureg) |
| void | statevec_cloneQureg (Qureg targetQureg, Qureg copyQureg) |
| works for both statevectors and density matrices More... | |
| void | statevec_collapseToKnownProbOutcome (Qureg qureg, const int measureQubit, int outcome, qreal outcomeProb) |
| void | statevec_compactUnitary (Qureg qureg, const int targetQubit, Complex alpha, Complex beta) |
| int | statevec_compareStates (Qureg mq1, Qureg mq2, qreal precision) |
| void | statevec_controlledCompactUnitary (Qureg qureg, const int controlQubit, const int targetQubit, Complex alpha, Complex beta) |
| void | statevec_controlledMultiQubitUnitary (Qureg qureg, int ctrl, int *targets, const int numTargets, ComplexMatrixN u) |
| void | statevec_controlledNot (Qureg qureg, const int controlQubit, const int targetQubit) |
| void | statevec_controlledPauliY (Qureg qureg, const int controlQubit, const int targetQubit) |
| void | statevec_controlledPauliYConj (Qureg qureg, const int controlQubit, const int targetQubit) |
| void | statevec_controlledPhaseFlip (Qureg qureg, const int idQubit1, const int idQubit2) |
| void | statevec_controlledPhaseShift (Qureg qureg, const int idQubit1, const int idQubit2, qreal angle) |
| void | statevec_controlledRotateAroundAxis (Qureg qureg, const int controlQubit, const int targetQubit, qreal angle, Vector axis) |
| void | statevec_controlledRotateAroundAxisConj (Qureg qureg, const int controlQubit, const int targetQubit, qreal angle, Vector axis) |
| void | statevec_controlledRotateX (Qureg qureg, const int controlQubit, const int targetQubit, qreal angle) |
| void | statevec_controlledRotateY (Qureg qureg, const int controlQubit, const int targetQubit, qreal angle) |
| void | statevec_controlledRotateZ (Qureg qureg, const int controlQubit, const int targetQubit, qreal angle) |
| void | statevec_controlledTwoQubitUnitary (Qureg qureg, const int controlQubit, const int targetQubit1, const int targetQubit2, ComplexMatrix4 u) |
| void | statevec_controlledUnitary (Qureg qureg, const int controlQubit, const int targetQubit, ComplexMatrix2 u) |
| void | statevec_createQureg (Qureg *qureg, int numQubits, QuESTEnv env) |
| void | statevec_destroyQureg (Qureg qureg, QuESTEnv env) |
| qreal | statevec_getImagAmp (Qureg qureg, long long int index) |
| qreal | statevec_getProbAmp (Qureg qureg, long long int index) |
| qreal | statevec_getRealAmp (Qureg qureg, long long int index) |
| void | statevec_hadamard (Qureg qureg, const int targetQubit) |
| void | statevec_initBlankState (Qureg qureg) |
| void | statevec_initClassicalState (Qureg qureg, long long int stateInd) |
| void | statevec_initDebugState (Qureg qureg) |
| Initialise the state vector of probability amplitudes to an (unphysical) state with each component of each probability amplitude a unique floating point value. More... | |
| void | statevec_initPlusState (Qureg qureg) |
| int | statevec_initStateFromSingleFile (Qureg *qureg, char filename[200], QuESTEnv env) |
| void | statevec_initStateOfSingleQubit (Qureg *qureg, int qubitId, int outcome) |
| Initialise the state vector of probability amplitudes such that one qubit is set to 'outcome' and all other qubits are in an equal superposition of zero and one. More... | |
| void | statevec_initZeroState (Qureg qureg) |
| int | statevec_measureWithStats (Qureg qureg, int measureQubit, qreal *outcomeProb) |
| void | statevec_multiControlledMultiQubitUnitary (Qureg qureg, long long int ctrlMask, int *targs, const int numTargs, ComplexMatrixN u) |
| This calls swapQubitAmps only when it would involve a distributed communication; if the qubit chunks already fit in the node, it operates the unitary direct. More... | |
| void | statevec_multiControlledPhaseFlip (Qureg qureg, int *controlQubits, int numControlQubits) |
| void | statevec_multiControlledPhaseShift (Qureg qureg, int *controlQubits, int numControlQubits, qreal angle) |
| void | statevec_multiControlledTwoQubitUnitary (Qureg qureg, long long int ctrlMask, const int targetQubit1, const int targetQubit2, ComplexMatrix4 u) |
| This calls swapQubitAmps only when it would involve a distributed communication; if the qubit chunks already fit in the node, it operates the unitary direct. More... | |
| void | statevec_multiControlledUnitary (Qureg qureg, long long int ctrlQubitsMask, long long int ctrlFlipMask, const int targetQubit, ComplexMatrix2 u) |
| void | statevec_multiQubitUnitary (Qureg qureg, int *targets, const int numTargets, ComplexMatrixN u) |
| void | statevec_multiRotatePauli (Qureg qureg, int *targetQubits, enum pauliOpType *targetPaulis, int numTargets, qreal angle, int applyConj) |
| applyConj=1 will apply conjugate operation, else applyConj=0 More... | |
| void | statevec_multiRotateZ (Qureg qureg, long long int mask, qreal angle) |
| void | statevec_pauliX (Qureg qureg, const int targetQubit) |
| void | statevec_pauliY (Qureg qureg, const int targetQubit) |
| void | statevec_pauliYConj (Qureg qureg, const int targetQubit) |
| void | statevec_pauliZ (Qureg qureg, const int targetQubit) |
| void | statevec_phaseShift (Qureg qureg, const int targetQubit, qreal angle) |
| void | statevec_phaseShiftByTerm (Qureg qureg, const int targetQubit, Complex term) |
| void | statevec_reportStateToScreen (Qureg qureg, QuESTEnv env, int reportRank) |
| Print the current state vector of probability amplitudes for a set of qubits to standard out. More... | |
| void | statevec_rotateAroundAxis (Qureg qureg, const int rotQubit, qreal angle, Vector axis) |
| void | statevec_rotateAroundAxisConj (Qureg qureg, const int rotQubit, qreal angle, Vector axis) |
| void | statevec_rotateX (Qureg qureg, const int rotQubit, qreal angle) |
| void | statevec_rotateY (Qureg qureg, const int rotQubit, qreal angle) |
| void | statevec_rotateZ (Qureg qureg, const int rotQubit, qreal angle) |
| void | statevec_setAmps (Qureg qureg, long long int startInd, qreal *reals, qreal *imags, long long int numAmps) |
| void | statevec_setWeightedQureg (Complex fac1, Qureg qureg1, Complex fac2, Qureg qureg2, Complex facOut, Qureg out) |
| void | statevec_sGate (Qureg qureg, const int targetQubit) |
| void | statevec_sGateConj (Qureg qureg, const int targetQubit) |
| void | statevec_sqrtSwapGate (Qureg qureg, int qb1, int qb2) |
| void | statevec_sqrtSwapGateConj (Qureg qureg, int qb1, int qb2) |
| void | statevec_swapQubitAmps (Qureg qureg, int qb1, int qb2) |
| void | statevec_tGate (Qureg qureg, const int targetQubit) |
| void | statevec_tGateConj (Qureg qureg, const int targetQubit) |
| void | statevec_twoQubitUnitary (Qureg qureg, const int targetQubit1, const int targetQubit2, ComplexMatrix4 u) |
| void | statevec_unitary (Qureg qureg, const int targetQubit, ComplexMatrix2 u) |
Detailed Description
General functions used internally, supplied by QuEST_common or by hardware-specific backends. Note that some bespoke functions used only internally exist in QuEST_qasm.h and QuEST_validation.h
Definition in file QuEST_internal.h.
Function Documentation
◆ conjugateMatrixN()
| void conjugateMatrixN | ( | ComplexMatrixN | u | ) |
◆ densmatr_calcFidelity()
Definition at line 415 of file QuEST_cpu_distributed.c.
References copySharedReduceBlock(), copyVecIntoMatrixPairState(), densmatr_calcFidelityLocal(), Qureg::firstLevelReduction, Qureg::numQubitsRepresented, Qureg::pairStateVec, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, Qureg::stateVec, and swapDouble().
Referenced by calcFidelity().
◆ densmatr_calcHilbertSchmidtDistance()
Definition at line 430 of file QuEST_cpu_distributed.c.
References copySharedReduceBlock(), densmatr_calcHilbertSchmidtDistanceSquaredLocal(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Qureg::numAmpsPerChunk, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcHilbertSchmidtDistance().
◆ densmatr_calcInnerProduct()
Definition at line 441 of file QuEST_cpu_distributed.c.
References copySharedReduceBlock(), densmatr_calcInnerProductLocal(), Qureg::firstLevelReduction, Qureg::numAmpsTotal, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcDensityInnerProduct().
◆ densmatr_calcProbOfOutcome()
Definition at line 1279 of file QuEST_cpu_distributed.c.
References densmatr_findProbabilityOfZero(), densmatr_findProbabilityOfZeroLocal(), and qreal.
Referenced by calcProbOfOutcome(), collapseToOutcome(), and densmatr_measureWithStats().
◆ densmatr_calcPurity()
Computes the trace of the density matrix squared.
Definition at line 1291 of file QuEST_cpu_distributed.c.
References copySharedReduceBlock(), densmatr_calcPurityLocal(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Qureg::numAmpsPerChunk, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcPurity().
◆ densmatr_calcTotalProb()
Definition at line 53 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, copyStateFromGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, Qureg::numQubitsRepresented, qreal, and Qureg::stateVec.
Referenced by calcTotalProb(), and statevec_calcExpecPauliProd().
◆ densmatr_collapseToKnownProbOutcome()
| void densmatr_collapseToKnownProbOutcome | ( | Qureg | qureg, |
| const int | measureQubit, | ||
| int | outcome, | ||
| qreal | outcomeProb | ||
| ) |
Renorms (/prob) every | * outcome * >< * outcome * | state, setting all others to zero.
Renorms (/prob) every | * outcome * >< * outcome * | state, setting all others to zero.
Definition at line 784 of file QuEST_cpu.c.
References alternateNormZeroingSomeAmpBlocks(), Qureg::chunkId, Qureg::deviceStateVec, extractBit(), normaliseSomeAmps(), Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, qreal, and zeroSomeAmps().
Referenced by collapseToOutcome(), and densmatr_measureWithStats().
◆ densmatr_initClassicalState()
| void densmatr_initClassicalState | ( | Qureg | qureg, |
| long long int | stateInd | ||
| ) |
Definition at line 1114 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, qreal, and Qureg::stateVec.
Referenced by initClassicalState().
◆ densmatr_initPlusState()
| void densmatr_initPlusState | ( | Qureg | targetQureg | ) |
Definition at line 1153 of file QuEST_cpu.c.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, qreal, and Qureg::stateVec.
Referenced by initPlusState().
◆ densmatr_initPureState()
Definition at line 452 of file QuEST_cpu_distributed.c.
References copyVecIntoMatrixPairState(), densmatr_initPureStateLocal(), Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numChunks, Qureg::pairStateVec, qreal, and Qureg::stateVec.
Referenced by initPureState().
◆ densmatr_measureWithStats()
Definition at line 368 of file QuEST_common.c.
References densmatr_calcProbOfOutcome(), densmatr_collapseToKnownProbOutcome(), generateMeasurementOutcome(), and qreal.
Referenced by measure(), and measureWithStats().
◆ densmatr_mixDamping()
Definition at line 727 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpperInOuterBlock(), compressPairVectorForSingleQubitDepolarise(), densityMatrixBlockFitsInChunk(), densmatr_mixDampingDistributed(), densmatr_mixDampingLocal(), densmatr_oneQubitDegradeOffDiagonal(), Qureg::deviceStateVec, exchangePairStateVectorHalves(), getChunkOuterBlockPairId(), Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixDamping().
◆ densmatr_mixDensityMatrix()
Definition at line 889 of file QuEST_cpu.c.
References Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by mixDensityMatrix().
◆ densmatr_mixDephasing()
Definition at line 79 of file QuEST_cpu.c.
References densmatr_oneQubitDegradeOffDiagonal(), and qreal.
Referenced by densmatr_mixDepolarising(), densmatr_mixDepolarisingDistributed(), and mixDephasing().
◆ densmatr_mixDepolarising()
Definition at line 700 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpperInOuterBlock(), compressPairVectorForSingleQubitDepolarise(), densityMatrixBlockFitsInChunk(), densmatr_mixDephasing(), densmatr_mixDepolarisingDistributed(), densmatr_mixDepolarisingLocal(), Qureg::deviceStateVec, exchangePairStateVectorHalves(), getChunkOuterBlockPairId(), Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixDepolarising().
◆ densmatr_mixKrausMap()
| void densmatr_mixKrausMap | ( | Qureg | qureg, |
| int | target, | ||
| ComplexMatrix2 * | ops, | ||
| int | numOps | ||
| ) |
Definition at line 599 of file QuEST_common.c.
References densmatr_applyKrausSuperoperator(), and populateKrausSuperOperator2().
Referenced by densmatr_mixPauli(), and mixKrausMap().
◆ densmatr_mixMultiQubitKrausMap()
| void densmatr_mixMultiQubitKrausMap | ( | Qureg | qureg, |
| int * | targets, | ||
| int | numTargets, | ||
| ComplexMatrixN * | ops, | ||
| int | numOps | ||
| ) |
Definition at line 642 of file QuEST_common.c.
References createComplexMatrixN(), densmatr_applyMultiQubitKrausSuperoperator(), destroyComplexMatrixN(), macro_allocStackComplexMatrixN, and populateKrausSuperOperatorN().
Referenced by mixMultiQubitKrausMap().
◆ densmatr_mixPauli()
Definition at line 675 of file QuEST_common.c.
References densmatr_mixKrausMap(), ComplexMatrix2::imag, qreal, and ComplexMatrix2::real.
Referenced by mixPauli().
◆ densmatr_mixTwoQubitDephasing()
| void densmatr_mixTwoQubitDephasing | ( | Qureg | qureg, |
| const int | qubit1, | ||
| const int | qubit2, | ||
| qreal | dephase | ||
| ) |
Definition at line 84 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, qreal, and Qureg::stateVec.
Referenced by densmatr_mixTwoQubitDepolarising(), and mixTwoQubitDephasing().
◆ densmatr_mixTwoQubitDepolarising()
Definition at line 754 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpperInOuterBlock(), compressPairVectorForTwoQubitDepolarise(), densityMatrixBlockFitsInChunk(), densmatr_mixTwoQubitDephasing(), densmatr_mixTwoQubitDepolarisingDistributed(), densmatr_mixTwoQubitDepolarisingLocal(), densmatr_mixTwoQubitDepolarisingLocalPart1(), densmatr_mixTwoQubitDepolarisingQ1LocalQ2DistributedPart3(), Qureg::deviceStateVec, exchangePairStateVectorHalves(), getChunkOuterBlockPairId(), getChunkOuterBlockPairIdForPart3(), Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixTwoQubitDepolarising().
◆ densmatr_mixTwoQubitKrausMap()
| void densmatr_mixTwoQubitKrausMap | ( | Qureg | qureg, |
| int | target1, | ||
| int | target2, | ||
| ComplexMatrix4 * | ops, | ||
| int | numOps | ||
| ) |
Definition at line 634 of file QuEST_common.c.
References densmatr_applyTwoQubitKrausSuperoperator(), macro_allocStackComplexMatrixN, and populateKrausSuperOperator4().
Referenced by mixTwoQubitKrausMap().
◆ ensureIndsIncrease()
| void ensureIndsIncrease | ( | int * | ind1, |
| int * | ind2 | ||
| ) |
Definition at line 63 of file QuEST_common.c.
Referenced by mixTwoQubitDephasing(), and mixTwoQubitDepolarising().
◆ getComplexPairAndPhaseFromUnitary()
| void getComplexPairAndPhaseFromUnitary | ( | ComplexMatrix2 | u, |
| Complex * | alpha, | ||
| Complex * | beta, | ||
| qreal * | globalPhase | ||
| ) |
maps U(r0c0, r0c1, r1c0, r1c1) to exp(i globalPhase) U(alpha, beta)
Definition at line 135 of file QuEST_common.c.
References Complex::imag, ComplexMatrix2::imag, qreal, Complex::real, and ComplexMatrix2::real.
Referenced by qasm_recordControlledUnitary(), qasm_recordMultiControlledUnitary(), and qasm_recordUnitary().
◆ getComplexPairFromRotation()
Definition at line 113 of file QuEST_common.c.
References getUnitVector(), Complex::imag, Complex::real, Vector::x, Vector::y, and Vector::z.
Referenced by qasm_recordAxisRotation(), qasm_recordControlledAxisRotation(), statevec_controlledRotateAroundAxis(), statevec_controlledRotateAroundAxisConj(), statevec_rotateAroundAxis(), and statevec_rotateAroundAxisConj().
◆ getConjugateMatrix2()
| ComplexMatrix2 getConjugateMatrix2 | ( | ComplexMatrix2 | src | ) |
Definition at line 98 of file QuEST_common.c.
References macro_setConjugateMatrix.
Referenced by controlledUnitary(), multiControlledUnitary(), multiStateControlledUnitary(), and unitary().
◆ getConjugateMatrix4()
| ComplexMatrix4 getConjugateMatrix4 | ( | ComplexMatrix4 | src | ) |
Definition at line 103 of file QuEST_common.c.
References macro_setConjugateMatrix.
Referenced by controlledTwoQubitUnitary(), multiControlledTwoQubitUnitary(), and twoQubitUnitary().
◆ getConjugateScalar()
Definition at line 84 of file QuEST_common.c.
References Complex::imag, and Complex::real.
Referenced by compactUnitary(), and controlledCompactUnitary().
◆ getControlFlipMask()
| long long int getControlFlipMask | ( | int * | controlQubits, |
| int * | controlState, | ||
| const int | numControlQubits | ||
| ) |
◆ getQubitBitMask()
| long long int getQubitBitMask | ( | int * | controlQubits, |
| const int | numControlQubits | ||
| ) |
Definition at line 43 of file QuEST_common.c.
Referenced by multiControlledMultiQubitUnitary(), multiControlledTwoQubitUnitary(), multiControlledUnitary(), multiRotateZ(), multiStateControlledUnitary(), statevec_multiControlledMultiQubitUnitary(), statevec_multiControlledPhaseFlip(), statevec_multiControlledPhaseShift(), statevec_multiRotatePauli(), and validateMultiControlsMultiTargets().
◆ getQuESTDefaultSeedKey()
| void getQuESTDefaultSeedKey | ( | unsigned long int * | key | ) |
Definition at line 181 of file QuEST_common.c.
Referenced by seedQuESTDefault().
◆ getVectorMagnitude()
Definition at line 72 of file QuEST_common.c.
References Vector::x, Vector::y, and Vector::z.
Referenced by getUnitVector(), and validateVector().
◆ getZYZRotAnglesFromComplexPair()
| void getZYZRotAnglesFromComplexPair | ( | Complex | alpha, |
| Complex | beta, | ||
| qreal * | rz2, | ||
| qreal * | ry, | ||
| qreal * | rz1 | ||
| ) |
maps U(alpha, beta) to Rz(rz2) Ry(ry) Rz(rz1)
Definition at line 123 of file QuEST_common.c.
References Complex::imag, qreal, and Complex::real.
Referenced by qasm_recordAxisRotation(), qasm_recordCompactUnitary(), qasm_recordControlledAxisRotation(), qasm_recordControlledCompactUnitary(), qasm_recordControlledUnitary(), qasm_recordMultiControlledUnitary(), and qasm_recordUnitary().
◆ hashString()
| unsigned long int hashString | ( | char * | str | ) |
Definition at line 171 of file QuEST_common.c.
◆ setConjugateMatrixN()
| void setConjugateMatrixN | ( | ComplexMatrixN | m | ) |
Definition at line 108 of file QuEST_common.c.
References macro_setConjugateMatrix, and ComplexMatrixN::numQubits.
Referenced by controlledMultiQubitUnitary(), multiControlledMultiQubitUnitary(), and multiQubitUnitary().
◆ shiftIndices()
| void shiftIndices | ( | int * | indices, |
| int | numIndices, | ||
| int | shift | ||
| ) |
Definition at line 149 of file QuEST_common.c.
Referenced by controlledMultiQubitUnitary(), multiControlledMultiQubitUnitary(), multiControlledPhaseFlip(), multiControlledPhaseShift(), multiQubitUnitary(), and multiRotatePauli().
◆ statevec_applyPauliSum()
| void statevec_applyPauliSum | ( | Qureg | inQureg, |
| enum pauliOpType * | allCodes, | ||
| qreal * | termCoeffs, | ||
| int | numSumTerms, | ||
| Qureg | outQureg | ||
| ) |
Definition at line 493 of file QuEST_common.c.
References Qureg::numQubitsRepresented, Complex::real, statevec_applyPauliProd(), statevec_initBlankState(), and statevec_setWeightedQureg().
Referenced by applyPauliSum().
◆ statevec_calcExpecPauliProd()
| qreal statevec_calcExpecPauliProd | ( | Qureg | qureg, |
| int * | targetQubits, | ||
| enum pauliOpType * | pauliCodes, | ||
| int | numTargets, | ||
| Qureg | workspace | ||
| ) |
Definition at line 464 of file QuEST_common.c.
References densmatr_calcTotalProb(), Qureg::isDensityMatrix, qreal, Complex::real, statevec_applyPauliProd(), statevec_calcInnerProduct(), and statevec_cloneQureg().
Referenced by calcExpecPauliProd(), and statevec_calcExpecPauliSum().
◆ statevec_calcExpecPauliSum()
| qreal statevec_calcExpecPauliSum | ( | Qureg | qureg, |
| enum pauliOpType * | allCodes, | ||
| qreal * | termCoeffs, | ||
| int | numSumTerms, | ||
| Qureg | workspace | ||
| ) |
Definition at line 479 of file QuEST_common.c.
References Qureg::numQubitsRepresented, qreal, and statevec_calcExpecPauliProd().
Referenced by calcExpecPauliSum().
◆ statevec_calcFidelity()
Definition at line 376 of file QuEST_common.c.
References Complex::imag, qreal, Complex::real, and statevec_calcInnerProduct().
Referenced by calcFidelity().
◆ statevec_calcInnerProduct()
Terrible code which unnecessarily individually computes and sums the real and imaginary components of the inner product, so as to not have to worry about keeping the sums separated during reduction.
Truly disgusting, probably doubles runtime, please fix. @TODO could even do the kernel twice, storing real in bra.reduc and imag in ket.reduc?
Definition at line 35 of file QuEST_cpu_distributed.c.
References copySharedReduceBlock(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Complex::imag, Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, Complex::real, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, statevec_calcInnerProductLocal(), and swapDouble().
Referenced by calcInnerProduct(), statevec_calcExpecPauliProd(), and statevec_calcFidelity().
◆ statevec_calcProbOfOutcome()
Definition at line 1263 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, halfMatrixBlockFitsInChunk(), isChunkToSkipInFindPZero(), Qureg::numAmpsPerChunk, qreal, statevec_findProbabilityOfZero(), statevec_findProbabilityOfZeroDistributed(), and statevec_findProbabilityOfZeroLocal().
Referenced by calcProbOfOutcome(), collapseToOutcome(), and statevec_measureWithStats().
◆ statevec_calcTotalProb()
Definition at line 88 of file QuEST_cpu_distributed.c.
References copyStateFromGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, and Qureg::stateVec.
Referenced by calcTotalProb().
◆ statevec_cloneQureg()
works for both statevectors and density matrices
Definition at line 1474 of file QuEST_cpu.c.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by cloneQureg(), createCloneQureg(), initPureState(), and statevec_calcExpecPauliProd().
◆ statevec_collapseToKnownProbOutcome()
| void statevec_collapseToKnownProbOutcome | ( | Qureg | qureg, |
| const int | measureQubit, | ||
| int | outcome, | ||
| qreal | outcomeProb | ||
| ) |
Definition at line 1301 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, halfMatrixBlockFitsInChunk(), isChunkToSkipInFindPZero(), Qureg::numAmpsPerChunk, qreal, statevec_collapseToKnownProbOutcomeDistributedRenorm(), statevec_collapseToKnownProbOutcomeLocal(), and statevec_collapseToOutcomeDistributedSetZero().
Referenced by collapseToOutcome(), and statevec_measureWithStats().
◆ statevec_compactUnitary()
Definition at line 846 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), getRotAngle(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_compactUnitaryDistributed(), and statevec_compactUnitaryLocal().
Referenced by compactUnitary(), statevec_multiRotatePauli(), statevec_rotateAroundAxis(), and statevec_rotateAroundAxisConj().
◆ statevec_compareStates()
Definition at line 1643 of file QuEST_cpu.c.
References copyStateFromGPU(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by compareStates().
◆ statevec_controlledCompactUnitary()
| void statevec_controlledCompactUnitary | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| Complex | alpha, | ||
| Complex | beta | ||
| ) |
Definition at line 922 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), getRotAngle(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_controlledCompactUnitaryDistributed(), and statevec_controlledCompactUnitaryLocal().
Referenced by controlledCompactUnitary(), statevec_controlledRotateAroundAxis(), and statevec_controlledRotateAroundAxisConj().
◆ statevec_controlledMultiQubitUnitary()
| void statevec_controlledMultiQubitUnitary | ( | Qureg | qureg, |
| int | ctrl, | ||
| int * | targets, | ||
| const int | numTargets, | ||
| ComplexMatrixN | u | ||
| ) |
Definition at line 534 of file QuEST_common.c.
References statevec_multiControlledMultiQubitUnitary().
Referenced by controlledMultiQubitUnitary().
◆ statevec_controlledNot()
| void statevec_controlledNot | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit | ||
| ) |
Definition at line 1063 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_controlledNotDistributed(), and statevec_controlledNotLocal().
Referenced by controlledNot().
◆ statevec_controlledPauliY()
| void statevec_controlledPauliY | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit | ||
| ) |
Definition at line 1142 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_controlledPauliYDistributed(), and statevec_controlledPauliYLocal().
Referenced by controlledPauliY().
◆ statevec_controlledPauliYConj()
| void statevec_controlledPauliYConj | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit | ||
| ) |
Definition at line 1175 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_controlledPauliYDistributed(), and statevec_controlledPauliYLocal().
Referenced by controlledPauliY().
◆ statevec_controlledPhaseFlip()
| void statevec_controlledPhaseFlip | ( | Qureg | qureg, |
| const int | idQubit1, | ||
| const int | idQubit2 | ||
| ) |
Definition at line 3260 of file QuEST_cpu.c.
References Qureg::chunkId, extractBit(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by controlledPhaseFlip().
◆ statevec_controlledPhaseShift()
| void statevec_controlledPhaseShift | ( | Qureg | qureg, |
| const int | idQubit1, | ||
| const int | idQubit2, | ||
| qreal | angle | ||
| ) |
Definition at line 2980 of file QuEST_cpu.c.
References Qureg::chunkId, extractBit(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by controlledPhaseShift().
◆ statevec_controlledRotateAroundAxis()
| void statevec_controlledRotateAroundAxis | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| qreal | angle, | ||
| Vector | axis | ||
| ) |
Definition at line 326 of file QuEST_common.c.
References getComplexPairFromRotation(), and statevec_controlledCompactUnitary().
Referenced by controlledRotateAroundAxis(), statevec_controlledRotateX(), statevec_controlledRotateY(), and statevec_controlledRotateZ().
◆ statevec_controlledRotateAroundAxisConj()
| void statevec_controlledRotateAroundAxisConj | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| qreal | angle, | ||
| Vector | axis | ||
| ) |
Definition at line 333 of file QuEST_common.c.
References getComplexPairFromRotation(), Complex::imag, and statevec_controlledCompactUnitary().
Referenced by controlledRotateAroundAxis().
◆ statevec_controlledRotateX()
| void statevec_controlledRotateX | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| qreal | angle | ||
| ) |
Definition at line 342 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateX().
◆ statevec_controlledRotateY()
| void statevec_controlledRotateY | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| qreal | angle | ||
| ) |
Definition at line 348 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateY().
◆ statevec_controlledRotateZ()
| void statevec_controlledRotateZ | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| qreal | angle | ||
| ) |
Definition at line 354 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateZ().
◆ statevec_controlledTwoQubitUnitary()
| void statevec_controlledTwoQubitUnitary | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit1, | ||
| const int | targetQubit2, | ||
| ComplexMatrix4 | u | ||
| ) |
Definition at line 522 of file QuEST_common.c.
References statevec_multiControlledTwoQubitUnitary().
Referenced by controlledTwoQubitUnitary().
◆ statevec_controlledUnitary()
| void statevec_controlledUnitary | ( | Qureg | qureg, |
| const int | controlQubit, | ||
| const int | targetQubit, | ||
| ComplexMatrix2 | u | ||
| ) |
Definition at line 960 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), getRotAngleFromUnitaryMatrix(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_controlledUnitaryDistributed(), and statevec_controlledUnitaryLocal().
Referenced by controlledUnitary().
◆ statevec_createQureg()
Definition at line 1278 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::firstLevelReduction, Qureg::isDensityMatrix, Qureg::numAmpsPerChunk, Qureg::numAmpsTotal, Qureg::numChunks, Qureg::numQubitsInStateVec, QuESTEnv::numRanks, Qureg::pairStateVec, qreal, QuESTEnv::rank, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and Qureg::stateVec.
Referenced by createCloneQureg(), createDensityQureg(), and createQureg().
◆ statevec_destroyQureg()
Definition at line 1316 of file QuEST_cpu.c.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numAmpsTotal, Qureg::numQubitsInStateVec, QuESTEnv::numRanks, Qureg::pairStateVec, and Qureg::stateVec.
Referenced by destroyQureg().
◆ statevec_getImagAmp()
Definition at line 208 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, Qureg::deviceStateVec, getChunkIdFromIndex(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by getAmp(), getDensityAmp(), getImagAmp(), and statevec_getProbAmp().
◆ statevec_getProbAmp()
Definition at line 244 of file QuEST_common.c.
References qreal, statevec_getImagAmp(), and statevec_getRealAmp().
Referenced by getProbAmp().
◆ statevec_getRealAmp()
Definition at line 198 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, Qureg::deviceStateVec, getChunkIdFromIndex(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by getAmp(), getDensityAmp(), getRealAmp(), and statevec_getProbAmp().
◆ statevec_hadamard()
| void statevec_hadamard | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 1208 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_hadamardDistributed(), and statevec_hadamardLocal().
Referenced by hadamard().
◆ statevec_initBlankState()
| void statevec_initBlankState | ( | Qureg | qureg | ) |
Definition at line 1366 of file QuEST_cpu.c.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by initBlankState(), statevec_applyPauliSum(), and statevec_initZeroState().
◆ statevec_initClassicalState()
| void statevec_initClassicalState | ( | Qureg | qureg, |
| long long int | stateInd | ||
| ) |
Definition at line 1438 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by initClassicalState().
◆ statevec_initDebugState()
| void statevec_initDebugState | ( | Qureg | qureg | ) |
Initialise the state vector of probability amplitudes to an (unphysical) state with each component of each probability amplitude a unique floating point value.
For debugging processes
- Parameters
-
[in,out] qureg object representing the set of qubits to be initialised
Definition at line 1559 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by initDebugState().
◆ statevec_initPlusState()
| void statevec_initPlusState | ( | Qureg | qureg | ) |
Definition at line 1406 of file QuEST_cpu.c.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, and Qureg::stateVec.
Referenced by initPlusState().
◆ statevec_initStateFromSingleFile()
Definition at line 1593 of file QuEST_cpu.c.
References Qureg::chunkId, copyStateToGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, Qureg::stateVec, and syncQuESTEnv().
Referenced by initStateFromSingleFile().
◆ statevec_initStateOfSingleQubit()
| void statevec_initStateOfSingleQubit | ( | Qureg * | qureg, |
| int | qubitId, | ||
| int | outcome | ||
| ) |
Initialise the state vector of probability amplitudes such that one qubit is set to 'outcome' and all other qubits are in an equal superposition of zero and one.
- Parameters
-
[in,out] qureg object representing the set of qubits to be initialised [in] qubitId id of qubit to set to state 'outcome' [in] value of qubit 'qubitId'
Definition at line 1513 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, and Qureg::stateVec.
Referenced by initStateOfSingleQubit().
◆ statevec_initZeroState()
| void statevec_initZeroState | ( | Qureg | qureg | ) |
Definition at line 1396 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, Qureg::stateVec, and statevec_initBlankState().
Referenced by initZeroState().
◆ statevec_measureWithStats()
Definition at line 360 of file QuEST_common.c.
References generateMeasurementOutcome(), qreal, statevec_calcProbOfOutcome(), and statevec_collapseToKnownProbOutcome().
Referenced by measure(), and measureWithStats().
◆ statevec_multiControlledMultiQubitUnitary()
| void statevec_multiControlledMultiQubitUnitary | ( | Qureg | qureg, |
| long long int | ctrlMask, | ||
| int * | targs, | ||
| const int | numTargs, | ||
| ComplexMatrixN | u | ||
| ) |
This calls swapQubitAmps only when it would involve a distributed communication; if the qubit chunks already fit in the node, it operates the unitary direct.
It is already gauranteed here that all target qubits can fit on each node (this is validated in the front-end)
@TODO: refactor so that the 'swap back' isn't performed; instead the qubit locations are updated.
Definition at line 1441 of file QuEST_cpu_distributed.c.
References flipBit(), getQubitBitMask(), halfMatrixBlockFitsInChunk(), ComplexMatrixN::imag, maskContainsBit(), Qureg::numAmpsPerChunk, ComplexMatrixN::numQubits, qreal, ComplexMatrixN::real, statevec_multiControlledMultiQubitUnitaryLocal(), and statevec_swapQubitAmps().
Referenced by densmatr_applyMultiQubitKrausSuperoperator(), densmatr_applyTwoQubitKrausSuperoperator(), multiControlledMultiQubitUnitary(), statevec_controlledMultiQubitUnitary(), and statevec_multiQubitUnitary().
◆ statevec_multiControlledPhaseFlip()
| void statevec_multiControlledPhaseFlip | ( | Qureg | qureg, |
| int * | controlQubits, | ||
| int | numControlQubits | ||
| ) |
Definition at line 3291 of file QuEST_cpu.c.
References Qureg::chunkId, getQubitBitMask(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by multiControlledPhaseFlip().
◆ statevec_multiControlledPhaseShift()
| void statevec_multiControlledPhaseShift | ( | Qureg | qureg, |
| int * | controlQubits, | ||
| int | numControlQubits, | ||
| qreal | angle | ||
| ) |
Definition at line 3019 of file QuEST_cpu.c.
References Qureg::chunkId, getQubitBitMask(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by multiControlledPhaseShift().
◆ statevec_multiControlledTwoQubitUnitary()
| void statevec_multiControlledTwoQubitUnitary | ( | Qureg | qureg, |
| long long int | ctrlMask, | ||
| const int | q1, | ||
| const int | q2, | ||
| ComplexMatrix4 | u | ||
| ) |
This calls swapQubitAmps only when it would involve a distributed communication; if the qubit chunks already fit in the node, it operates the unitary direct.
Note the order of q1 and q2 in the call to twoQubitUnitaryLocal is important.
@TODO: refactor so that the 'swap back' isn't performed; instead the qubit locations are updated. @TODO: the double swap (q1,q2 to 0,1) may be possible simultaneously by a bespoke swap routine.
Definition at line 1385 of file QuEST_cpu_distributed.c.
References flipBit(), halfMatrixBlockFitsInChunk(), maskContainsBit(), Qureg::numAmpsPerChunk, qreal, statevec_multiControlledTwoQubitUnitaryLocal(), and statevec_swapQubitAmps().
Referenced by densmatr_applyKrausSuperoperator(), multiControlledTwoQubitUnitary(), statevec_controlledTwoQubitUnitary(), and statevec_twoQubitUnitary().
◆ statevec_multiControlledUnitary()
| void statevec_multiControlledUnitary | ( | Qureg | qureg, |
| long long int | ctrlQubitsMask, | ||
| long long int | ctrlFlipMask, | ||
| const int | targetQubit, | ||
| ComplexMatrix2 | u | ||
| ) |
Definition at line 999 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), getRotAngleFromUnitaryMatrix(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_multiControlledUnitaryDistributed(), and statevec_multiControlledUnitaryLocal().
Referenced by multiControlledUnitary(), and multiStateControlledUnitary().
◆ statevec_multiQubitUnitary()
| void statevec_multiQubitUnitary | ( | Qureg | qureg, |
| int * | targets, | ||
| const int | numTargets, | ||
| ComplexMatrixN | u | ||
| ) |
Definition at line 528 of file QuEST_common.c.
References statevec_multiControlledMultiQubitUnitary().
Referenced by multiQubitUnitary().
◆ statevec_multiRotatePauli()
| void statevec_multiRotatePauli | ( | Qureg | qureg, |
| int * | targetQubits, | ||
| enum pauliOpType * | targetPaulis, | ||
| int | numTargets, | ||
| qreal | angle, | ||
| int | applyConj | ||
| ) |
applyConj=1 will apply conjugate operation, else applyConj=0
Definition at line 410 of file QuEST_common.c.
References getQubitBitMask(), Complex::imag, PAULI_I, PAULI_X, PAULI_Y, qreal, Complex::real, statevec_compactUnitary(), and statevec_multiRotateZ().
Referenced by multiRotatePauli().
◆ statevec_multiRotateZ()
Definition at line 3069 of file QuEST_cpu.c.
References Qureg::chunkId, getBitMaskParity(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by multiRotateZ(), and statevec_multiRotatePauli().
◆ statevec_pauliX()
| void statevec_pauliX | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 1036 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_pauliXDistributed(), and statevec_pauliXLocal().
Referenced by pauliX(), and statevec_applyPauliProd().
◆ statevec_pauliY()
| void statevec_pauliY | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 1092 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_pauliYDistributed(), and statevec_pauliYLocal().
Referenced by pauliY(), and statevec_applyPauliProd().
◆ statevec_pauliYConj()
| void statevec_pauliYConj | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 1117 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_pauliYDistributed(), and statevec_pauliYLocal().
Referenced by pauliY().
◆ statevec_pauliZ()
| void statevec_pauliZ | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 257 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by pauliZ(), and statevec_applyPauliProd().
◆ statevec_phaseShift()
Definition at line 250 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by phaseShift().
◆ statevec_phaseShiftByTerm()
Definition at line 2940 of file QuEST_cpu.c.
References Qureg::chunkId, extractBit(), Complex::imag, Qureg::numAmpsPerChunk, qreal, Complex::real, and Qureg::stateVec.
Referenced by statevec_pauliZ(), statevec_phaseShift(), statevec_sGate(), statevec_sGateConj(), statevec_tGate(), and statevec_tGateConj().
◆ statevec_reportStateToScreen()
Print the current state vector of probability amplitudes for a set of qubits to standard out.
For debugging purposes. Each rank should print output serially. Only print output for systems <= 5 qubits
Definition at line 1334 of file QuEST_cpu.c.
References Qureg::chunkId, copyStateFromGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, Qureg::numQubitsInStateVec, Qureg::stateVec, and syncQuESTEnv().
Referenced by reportStateToScreen().
◆ statevec_rotateAroundAxis()
Definition at line 310 of file QuEST_common.c.
References getComplexPairFromRotation(), and statevec_compactUnitary().
Referenced by rotateAroundAxis(), statevec_rotateX(), statevec_rotateY(), and statevec_rotateZ().
◆ statevec_rotateAroundAxisConj()
Definition at line 317 of file QuEST_common.c.
References getComplexPairFromRotation(), Complex::imag, and statevec_compactUnitary().
Referenced by rotateAroundAxis().
◆ statevec_rotateX()
Definition at line 292 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateX().
◆ statevec_rotateY()
Definition at line 298 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateY().
◆ statevec_rotateZ()
Definition at line 304 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateZ().
◆ statevec_setAmps()
| void statevec_setAmps | ( | Qureg | qureg, |
| long long int | startInd, | ||
| qreal * | reals, | ||
| qreal * | imags, | ||
| long long int | numAmps | ||
| ) |
Definition at line 1236 of file QuEST_cpu.c.
References Qureg::chunkId, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by initStateFromAmps(), setAmps(), and setDensityAmps().
◆ statevec_setWeightedQureg()
| void statevec_setWeightedQureg | ( | Complex | fac1, |
| Qureg | qureg1, | ||
| Complex | fac2, | ||
| Qureg | qureg2, | ||
| Complex | facOut, | ||
| Qureg | out | ||
| ) |
Definition at line 3579 of file QuEST_cpu.c.
References Complex::imag, Qureg::numAmpsPerChunk, qreal, Complex::real, and Qureg::stateVec.
Referenced by setWeightedQureg(), and statevec_applyPauliSum().
◆ statevec_sGate()
| void statevec_sGate | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 264 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by sGate().
◆ statevec_sGateConj()
| void statevec_sGateConj | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 278 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by sGate().
◆ statevec_sqrtSwapGate()
| void statevec_sqrtSwapGate | ( | Qureg | qureg, |
| int | qb1, | ||
| int | qb2 | ||
| ) |
Definition at line 383 of file QuEST_common.c.
References ComplexMatrix4::imag, ComplexMatrix4::real, and statevec_twoQubitUnitary().
Referenced by sqrtSwapGate().
◆ statevec_sqrtSwapGateConj()
| void statevec_sqrtSwapGateConj | ( | Qureg | qureg, |
| int | qb1, | ||
| int | qb2 | ||
| ) |
Definition at line 396 of file QuEST_common.c.
References ComplexMatrix4::imag, ComplexMatrix4::real, and statevec_twoQubitUnitary().
Referenced by sqrtSwapGate().
◆ statevec_swapQubitAmps()
| void statevec_swapQubitAmps | ( | Qureg | qureg, |
| int | qb1, | ||
| int | qb2 | ||
| ) |
Definition at line 1358 of file QuEST_cpu_distributed.c.
References exchangeStateVectors(), flipBit(), getGlobalIndOfOddParityInChunk(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, qreal, statevec_swapQubitAmpsDistributed(), and statevec_swapQubitAmpsLocal().
Referenced by statevec_multiControlledMultiQubitUnitary(), statevec_multiControlledTwoQubitUnitary(), and swapGate().
◆ statevec_tGate()
| void statevec_tGate | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 271 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by tGate().
◆ statevec_tGateConj()
| void statevec_tGateConj | ( | Qureg | qureg, |
| const int | targetQubit | ||
| ) |
Definition at line 285 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by tGate().
◆ statevec_twoQubitUnitary()
| void statevec_twoQubitUnitary | ( | Qureg | qureg, |
| const int | targetQubit1, | ||
| const int | targetQubit2, | ||
| ComplexMatrix4 | u | ||
| ) |
Definition at line 516 of file QuEST_common.c.
References statevec_multiControlledTwoQubitUnitary().
Referenced by statevec_sqrtSwapGate(), statevec_sqrtSwapGateConj(), and twoQubitUnitary().
◆ statevec_unitary()
| void statevec_unitary | ( | Qureg | qureg, |
| const int | targetQubit, | ||
| ComplexMatrix2 | u | ||
| ) |
Definition at line 883 of file QuEST_cpu_distributed.c.
References Qureg::chunkId, chunkIsUpper(), exchangeStateVectors(), getChunkPairId(), getRotAngleFromUnitaryMatrix(), halfMatrixBlockFitsInChunk(), Qureg::numAmpsPerChunk, Qureg::pairStateVec, qreal, Qureg::stateVec, statevec_unitaryDistributed(), and statevec_unitaryLocal().
Referenced by unitary().