#include "QuEST.h"
#include "QuEST_precision.h"
#include "QuEST_internal.h"
#include "mt19937ar.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | DEBUG 0 |
#define | REDUCE_SHARED_SIZE 512 |
Functions | |
DiagonalOp | agnostic_createDiagonalOp (int numQubits, QuESTEnv env) |
void | agnostic_destroyDiagonalOp (DiagonalOp op) |
void | agnostic_initDiagonalOpFromPauliHamil (DiagonalOp op, PauliHamil hamil) |
__global__ void | agnostic_initDiagonalOpFromPauliHamilKernel (DiagonalOp op, enum pauliOpType *pauliCodes, qreal *termCoeffs, int numSumTerms) |
void | agnostic_setDiagonalOpElems (DiagonalOp op, long long int startInd, qreal *real, qreal *imag, long long int numElems) |
void | agnostic_syncDiagonalOp (DiagonalOp op) |
__global__ void | copySharedReduceBlock (qreal *arrayIn, qreal *reducedArray, int length) |
void | copyStateFromGPU (Qureg qureg) |
In GPU mode, this copies the state-vector (or density matrix) from GPU memory (qureg.deviceStateVec) to RAM (qureg.stateVec), where it can be accessed/modified by the user. More... | |
void | copyStateToGPU (Qureg qureg) |
In GPU mode, this copies the state-vector (or density matrix) from RAM (qureg.stateVec) to VRAM / GPU-memory (qureg.deviceStateVec), which is the version operated upon by other calls to the API. More... | |
QuESTEnv | createQuESTEnv (void) |
Create the QuEST execution environment. More... | |
void | densmatr_applyDiagonalOp (Qureg qureg, DiagonalOp op) |
__global__ void | densmatr_applyDiagonalOpKernel (Qureg qureg, DiagonalOp op) |
Complex | densmatr_calcExpecDiagonalOp (Qureg qureg, DiagonalOp op) |
__global__ void | densmatr_calcExpecDiagonalOpKernel (int getRealComp, qreal *matReal, qreal *matImag, qreal *opReal, qreal *opImag, int numQubits, long long int numTermsToSum, qreal *reducedArray) |
qreal | densmatr_calcFidelity (Qureg qureg, Qureg pureState) |
__global__ void | densmatr_calcFidelityKernel (Qureg dens, Qureg vec, long long int dim, qreal *reducedArray) |
computes one term of (vec^*T) dens * vec More... | |
qreal | densmatr_calcHilbertSchmidtDistance (Qureg a, Qureg b) |
__global__ void | densmatr_calcHilbertSchmidtDistanceSquaredKernel (qreal *aRe, qreal *aIm, qreal *bRe, qreal *bIm, long long int numAmpsToSum, qreal *reducedArray) |
qreal | densmatr_calcInnerProduct (Qureg a, Qureg b) |
__global__ void | densmatr_calcInnerProductKernel (Qureg a, Qureg b, long long int numTermsToSum, qreal *reducedArray) |
computes Tr(conjTrans(a) b) = sum of (a_ij^* b_ij), which is a real number More... | |
void | densmatr_calcProbOfAllOutcomes (qreal *outcomeProbs, Qureg qureg, int *qubits, int numQubits) |
__global__ void | densmatr_calcProbOfAllOutcomesKernel (qreal *outcomeProbs, Qureg qureg, int *qubits, int numQubits) |
qreal | densmatr_calcProbOfOutcome (Qureg qureg, int measureQubit, int outcome) |
qreal | densmatr_calcPurity (Qureg qureg) |
Computes the trace of the density matrix squared. More... | |
__global__ void | densmatr_calcPurityKernel (qreal *vecReal, qreal *vecImag, long long int numAmpsToSum, qreal *reducedArray) |
qreal | densmatr_calcTotalProb (Qureg qureg) |
void | densmatr_collapseToKnownProbOutcome (Qureg qureg, int measureQubit, int outcome, qreal outcomeProb) |
This involves finding |...i...><...j...| states and killing those where i!=j. More... | |
__global__ void | densmatr_collapseToKnownProbOutcomeKernel (qreal outcomeProb, qreal *vecReal, qreal *vecImag, long long int numBasesToVisit, long long int part1, long long int part2, long long int part3, long long int rowBit, long long int colBit, long long int desired, long long int undesired) |
Maps thread ID to a |..0..><..0..| state and then locates |0><1|, |1><0| and |1><1|. More... | |
qreal | densmatr_findProbabilityOfZero (Qureg qureg, int measureQubit) |
__global__ void | densmatr_findProbabilityOfZeroKernel (Qureg qureg, int measureQubit, qreal *reducedArray) |
void | densmatr_initClassicalState (Qureg qureg, long long int stateInd) |
__global__ void | densmatr_initClassicalStateKernel (long long int densityNumElems, qreal *densityReal, qreal *densityImag, long long int densityInd) |
void | densmatr_initPlusState (Qureg qureg) |
__global__ void | densmatr_initPlusStateKernel (long long int stateVecSize, qreal probFactor, qreal *stateVecReal, qreal *stateVecImag) |
void | densmatr_initPureState (Qureg targetQureg, Qureg copyQureg) |
__global__ void | densmatr_initPureStateKernel (long long int numPureAmps, qreal *targetVecReal, qreal *targetVecImag, qreal *copyVecReal, qreal *copyVecImag) |
void | densmatr_mixDamping (Qureg qureg, int targetQubit, qreal damping) |
__global__ void | densmatr_mixDampingKernel (qreal damping, qreal *vecReal, qreal *vecImag, long long int numAmpsToVisit, long long int part1, long long int part2, long long int part3, long long int bothBits) |
Works like mixDephasing but modifies every other element, and elements are averaged in pairs. More... | |
void | densmatr_mixDensityMatrix (Qureg combineQureg, qreal otherProb, Qureg otherQureg) |
__global__ void | densmatr_mixDensityMatrixKernel (Qureg combineQureg, qreal otherProb, Qureg otherQureg, long long int numAmpsToVisit) |
void | densmatr_mixDephasing (Qureg qureg, int targetQubit, qreal dephase) |
__global__ void | densmatr_mixDephasingKernel (qreal fac, qreal *vecReal, qreal *vecImag, long long int numAmpsToVisit, long long int part1, long long int part2, long long int part3, long long int colBit, long long int rowBit) |
Called once for every 4 amplitudes in density matrix Works by establishing the |..0..><..0..| state (for its given index) then visiting |..1..><..0..| and |..0..><..1..|. More... | |
void | densmatr_mixDepolarising (Qureg qureg, int targetQubit, qreal depolLevel) |
__global__ void | densmatr_mixDepolarisingKernel (qreal depolLevel, qreal *vecReal, qreal *vecImag, long long int numAmpsToVisit, long long int part1, long long int part2, long long int part3, long long int bothBits) |
Works like mixDephasing but modifies every other element, and elements are averaged in pairs. More... | |
void | densmatr_mixTwoQubitDephasing (Qureg qureg, int qubit1, int qubit2, qreal dephase) |
__global__ void | densmatr_mixTwoQubitDephasingKernel (qreal fac, qreal *vecReal, qreal *vecImag, long long int numBackgroundStates, long long int numAmpsToVisit, long long int part1, long long int part2, long long int part3, long long int part4, long long int part5, long long int colBit1, long long int rowBit1, long long int colBit2, long long int rowBit2) |
Called 12 times for every 16 amplitudes in density matrix Each sums from the |..0..0..><..0..0..| index to visit either |..0..0..><..0..1..|, |..0..0..><..1..0..|, |..0..0..><..1..1..|, |..0..1..><..0..0..| etc and so on to |..1..1..><..1..0|. More... | |
void | densmatr_mixTwoQubitDepolarising (Qureg qureg, int qubit1, int qubit2, qreal depolLevel) |
__global__ void | densmatr_mixTwoQubitDepolarisingKernel (qreal depolLevel, qreal *vecReal, qreal *vecImag, long long int numAmpsToVisit, long long int part1, long long int part2, long long int part3, long long int part4, long long int part5, long long int rowCol1, long long int rowCol2) |
Called once for every 16 amplitudes. More... | |
void | densmatr_oneQubitDegradeOffDiagonal (Qureg qureg, int targetQubit, qreal dephFac) |
void | destroyQuESTEnv (QuESTEnv env) |
Destroy the QuEST environment. More... | |
__forceinline__ __device__ int | extractBit (const int locationOfBitFromRight, const long long int theEncodedNumber) |
__forceinline__ __device__ long long int | flipBit (const long long int number, const int bitInd) |
__forceinline__ __device__ int | getBitMaskParity (long long int mask) |
void | getEnvironmentString (QuESTEnv env, char str[200]) |
Sets str to a string containing information about the runtime environment, including whether simulation is using CUDA (for GPU), OpenMP (for multithreading) and/or MPI (for distribution). More... | |
int | getNumReductionLevels (long long int numValuesToReduce, int numReducedPerLevel) |
int | GPUExists (void) |
__forceinline__ __device__ long long int | insertTwoZeroBits (const long long int number, const int bit1, const int bit2) |
__forceinline__ __device__ long long int | insertZeroBit (const long long int number, const int index) |
__forceinline__ __device__ long long int | insertZeroBits (long long int number, int *inds, const int numInds) |
__device__ __host__ unsigned int | log2Int (unsigned int x) |
__device__ void | reduceBlock (qreal *arrayIn, qreal *reducedArray, int length) |
void | reportQuESTEnv (QuESTEnv env) |
Report information about the QuEST environment. More... | |
void | seedQuEST (QuESTEnv *env, unsigned long int *seedArray, int numSeeds) |
Seeds the random number generator with a custom array of key(s), overriding the default keys. More... | |
void | statevec_applyDiagonalOp (Qureg qureg, DiagonalOp op) |
__global__ void | statevec_applyDiagonalOpKernel (Qureg qureg, DiagonalOp op) |
void | statevec_applyMultiVarPhaseFuncOverrides (Qureg qureg, int *qubits, int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, qreal *coeffs, qreal *exponents, int *numTermsPerReg, long long int *overrideInds, qreal *overridePhases, int numOverrides, int conj) |
__global__ void | statevec_applyMultiVarPhaseFuncOverridesKernel (Qureg qureg, int *qubits, int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, qreal *coeffs, qreal *exponents, int *numTermsPerReg, long long int *overrideInds, qreal *overridePhases, int numOverrides, long long int *phaseInds, int conj) |
void | statevec_applyParamNamedPhaseFuncOverrides (Qureg qureg, int *qubits, int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, enum phaseFunc phaseFuncName, qreal *params, int numParams, long long int *overrideInds, qreal *overridePhases, int numOverrides, int conj) |
__global__ void | statevec_applyParamNamedPhaseFuncOverridesKernel (Qureg qureg, int *qubits, int *numQubitsPerReg, int numRegs, enum bitEncoding encoding, enum phaseFunc phaseFuncName, qreal *params, int numParams, long long int *overrideInds, qreal *overridePhases, int numOverrides, long long int *phaseInds, int conj) |
void | statevec_applyPhaseFuncOverrides (Qureg qureg, int *qubits, int numQubits, enum bitEncoding encoding, qreal *coeffs, qreal *exponents, int numTerms, long long int *overrideInds, qreal *overridePhases, int numOverrides, int conj) |
__global__ void | statevec_applyPhaseFuncOverridesKernel (Qureg qureg, int *qubits, int numQubits, enum bitEncoding encoding, qreal *coeffs, qreal *exponents, int numTerms, long long int *overrideInds, qreal *overridePhases, int numOverrides, int conj) |
Complex | statevec_calcExpecDiagonalOp (Qureg qureg, DiagonalOp op) |
__global__ void | statevec_calcExpecDiagonalOpKernel (int getRealComp, qreal *vecReal, qreal *vecImag, qreal *opReal, qreal *opImag, long long int numTermsToSum, qreal *reducedArray) |
computes either a real or imag term of |vec_i|^2 op_i More... | |
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... | |
__global__ void | statevec_calcInnerProductKernel (int getRealComp, qreal *vecReal1, qreal *vecImag1, qreal *vecReal2, qreal *vecImag2, long long int numTermsToSum, qreal *reducedArray) |
computes either a real or imag term in the inner product More... | |
void | statevec_calcProbOfAllOutcomes (qreal *outcomeProbs, Qureg qureg, int *qubits, int numQubits) |
__global__ void | statevec_calcProbOfAllOutcomesKernel (qreal *outcomeProbs, Qureg qureg, int *qubits, int numQubits) |
qreal | statevec_calcProbOfOutcome (Qureg qureg, 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, int measureQubit, int outcome, qreal outcomeProb) |
__global__ void | statevec_collapseToKnownProbOutcomeKernel (Qureg qureg, int measureQubit, int outcome, qreal totalProbability) |
void | statevec_compactUnitary (Qureg qureg, int targetQubit, Complex alpha, Complex beta) |
__global__ void | statevec_compactUnitaryKernel (Qureg qureg, int rotQubit, Complex alpha, Complex beta) |
int | statevec_compareStates (Qureg mq1, Qureg mq2, qreal precision) |
void | statevec_controlledCompactUnitary (Qureg qureg, int controlQubit, int targetQubit, Complex alpha, Complex beta) |
__global__ void | statevec_controlledCompactUnitaryKernel (Qureg qureg, int controlQubit, int targetQubit, Complex alpha, Complex beta) |
void | statevec_controlledNot (Qureg qureg, int controlQubit, int targetQubit) |
__global__ void | statevec_controlledNotKernel (Qureg qureg, int controlQubit, int targetQubit) |
void | statevec_controlledPauliY (Qureg qureg, int controlQubit, int targetQubit) |
void | statevec_controlledPauliYConj (Qureg qureg, int controlQubit, int targetQubit) |
__global__ void | statevec_controlledPauliYKernel (Qureg qureg, int controlQubit, int targetQubit, int conjFac) |
void | statevec_controlledPhaseFlip (Qureg qureg, int idQubit1, int idQubit2) |
__global__ void | statevec_controlledPhaseFlipKernel (Qureg qureg, int idQubit1, int idQubit2) |
void | statevec_controlledPhaseShift (Qureg qureg, int idQubit1, int idQubit2, qreal angle) |
__global__ void | statevec_controlledPhaseShiftKernel (Qureg qureg, int idQubit1, int idQubit2, qreal cosAngle, qreal sinAngle) |
void | statevec_controlledUnitary (Qureg qureg, int controlQubit, int targetQubit, ComplexMatrix2 u) |
__global__ void | statevec_controlledUnitaryKernel (Qureg qureg, int controlQubit, int targetQubit, ArgMatrix2 u) |
void | statevec_createQureg (Qureg *qureg, int numQubits, QuESTEnv env) |
void | statevec_destroyQureg (Qureg qureg, QuESTEnv env) |
qreal | statevec_findProbabilityOfZero (Qureg qureg, int measureQubit) |
__global__ void | statevec_findProbabilityOfZeroKernel (Qureg qureg, int measureQubit, qreal *reducedArray) |
qreal | statevec_getImagAmp (Qureg qureg, long long int index) |
qreal | statevec_getRealAmp (Qureg qureg, long long int index) |
void | statevec_hadamard (Qureg qureg, int targetQubit) |
__global__ void | statevec_hadamardKernel (Qureg qureg, int targetQubit) |
void | statevec_initBlankState (Qureg qureg) |
__global__ void | statevec_initBlankStateKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag) |
void | statevec_initClassicalState (Qureg qureg, long long int stateInd) |
__global__ void | statevec_initClassicalStateKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag, 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... | |
__global__ void | statevec_initDebugStateKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag) |
void | statevec_initPlusState (Qureg qureg) |
__global__ void | statevec_initPlusStateKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag) |
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... | |
__global__ void | statevec_initStateOfSingleQubitKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag, int qubitId, int outcome) |
void | statevec_initZeroState (Qureg qureg) |
__global__ void | statevec_initZeroStateKernel (long long int stateVecSize, qreal *stateVecReal, qreal *stateVecImag) |
void | statevec_multiControlledMultiQubitNot (Qureg qureg, int ctrlMask, int targMask) |
__global__ void | statevec_multiControlledMultiQubitNotKernel (Qureg qureg, int ctrlMask, int targMask) |
void | statevec_multiControlledMultiQubitUnitary (Qureg qureg, long long int ctrlMask, int *targs, 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... | |
__global__ void | statevec_multiControlledMultiQubitUnitaryKernel (Qureg qureg, long long int ctrlMask, int *targs, int numTargs, qreal *uRe, qreal *uIm, long long int *ampInds, qreal *reAmps, qreal *imAmps, long long int numTargAmps) |
void | statevec_multiControlledMultiRotateZ (Qureg qureg, long long int ctrlMask, long long int targMask, qreal angle) |
__global__ void | statevec_multiControlledMultiRotateZKernel (Qureg qureg, long long int ctrlMask, long long int targMask, qreal cosAngle, qreal sinAngle) |
void | statevec_multiControlledPhaseFlip (Qureg qureg, int *controlQubits, int numControlQubits) |
__global__ void | statevec_multiControlledPhaseFlipKernel (Qureg qureg, long long int mask) |
void | statevec_multiControlledPhaseShift (Qureg qureg, int *controlQubits, int numControlQubits, qreal angle) |
__global__ void | statevec_multiControlledPhaseShiftKernel (Qureg qureg, long long int mask, qreal cosAngle, qreal sinAngle) |
void | statevec_multiControlledTwoQubitUnitary (Qureg qureg, long long int ctrlMask, int q1, 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. More... | |
__global__ void | statevec_multiControlledTwoQubitUnitaryKernel (Qureg qureg, long long int ctrlMask, int q1, int q2, ArgMatrix4 u) |
void | statevec_multiControlledUnitary (Qureg qureg, long long int ctrlQubitsMask, long long int ctrlFlipMask, int targetQubit, ComplexMatrix2 u) |
__global__ void | statevec_multiControlledUnitaryKernel (Qureg qureg, long long int ctrlQubitsMask, long long int ctrlFlipMask, int targetQubit, ArgMatrix2 u) |
void | statevec_multiRotateZ (Qureg qureg, long long int mask, qreal angle) |
__global__ void | statevec_multiRotateZKernel (Qureg qureg, long long int mask, qreal cosAngle, qreal sinAngle) |
void | statevec_pauliX (Qureg qureg, int targetQubit) |
__global__ void | statevec_pauliXKernel (Qureg qureg, int targetQubit) |
void | statevec_pauliY (Qureg qureg, int targetQubit) |
void | statevec_pauliYConj (Qureg qureg, int targetQubit) |
__global__ void | statevec_pauliYKernel (Qureg qureg, int targetQubit, int conjFac) |
void | statevec_phaseShiftByTerm (Qureg qureg, int targetQubit, Complex term) |
__global__ void | statevec_phaseShiftByTermKernel (Qureg qureg, int targetQubit, qreal cosAngle, qreal sinAngle) |
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_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) |
__global__ void | statevec_setWeightedQuregKernel (Complex fac1, Qureg qureg1, Complex fac2, Qureg qureg2, Complex facOut, Qureg out) |
void | statevec_swapQubitAmps (Qureg qureg, int qb1, int qb2) |
__global__ void | statevec_swapQubitAmpsKernel (Qureg qureg, int qb1, int qb2) |
void | statevec_unitary (Qureg qureg, int targetQubit, ComplexMatrix2 u) |
__global__ void | statevec_unitaryKernel (Qureg qureg, int targetQubit, ArgMatrix2 u) |
void | swapDouble (qreal **a, qreal **b) |
void | syncQuESTEnv (QuESTEnv env) |
Guarantees that all code up to the given point has been executed on all nodes (if running in distributed mode) More... | |
int | syncQuESTSuccess (int successCode) |
Performs a logical AND on all successCodes held by all processes. More... | |
Detailed Description
An implementation of the backend in ../QuEST_internal.h for a GPU environment.
Definition in file QuEST_gpu.cu.
Macro Definition Documentation
◆ DEBUG
#define DEBUG 0 |
Definition at line 20 of file QuEST_gpu.cu.
◆ REDUCE_SHARED_SIZE
#define REDUCE_SHARED_SIZE 512 |
Definition at line 19 of file QuEST_gpu.cu.
Function Documentation
◆ agnostic_createDiagonalOp()
DiagonalOp agnostic_createDiagonalOp | ( | int | numQubits, |
QuESTEnv | env | ||
) |
Definition at line 338 of file QuEST_gpu.cu.
References DiagonalOp::chunkId, DiagonalOp::deviceOperator, DiagonalOp::imag, DiagonalOp::numChunks, DiagonalOp::numElemsPerChunk, DiagonalOp::numQubits, QuESTEnv::numRanks, qreal, QuESTEnv::rank, and DiagonalOp::real.
Referenced by createDiagonalOp(), and createDiagonalOpFromPauliHamilFile().
◆ agnostic_destroyDiagonalOp()
void agnostic_destroyDiagonalOp | ( | DiagonalOp | op | ) |
Definition at line 375 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, DiagonalOp::imag, and DiagonalOp::real.
Referenced by destroyDiagonalOp().
◆ agnostic_initDiagonalOpFromPauliHamil()
void agnostic_initDiagonalOpFromPauliHamil | ( | DiagonalOp | op, |
PauliHamil | hamil | ||
) |
Definition at line 418 of file QuEST_gpu.cu.
References DiagonalOp::numElemsPerChunk, DiagonalOp::numQubits, PauliHamil::numSumTerms, PauliHamil::pauliCodes, qreal, and PauliHamil::termCoeffs.
Referenced by createDiagonalOpFromPauliHamilFile(), and initDiagonalOpFromPauliHamil().
◆ agnostic_initDiagonalOpFromPauliHamilKernel()
__global__ void agnostic_initDiagonalOpFromPauliHamilKernel | ( | DiagonalOp | op, |
enum pauliOpType * | pauliCodes, | ||
qreal * | termCoeffs, | ||
int | numSumTerms | ||
) |
Definition at line 389 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, extractBit(), DiagonalOp::numElemsPerChunk, DiagonalOp::numQubits, PAULI_Z, and qreal.
◆ agnostic_setDiagonalOpElems()
void agnostic_setDiagonalOpElems | ( | DiagonalOp | op, |
long long int | startInd, | ||
qreal * | real, | ||
qreal * | imag, | ||
long long int | numElems | ||
) |
Definition at line 3503 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, DiagonalOp::imag, qreal, and DiagonalOp::real.
Referenced by initDiagonalOp(), and setDiagonalOpElems().
◆ agnostic_syncDiagonalOp()
void agnostic_syncDiagonalOp | ( | DiagonalOp | op | ) |
Definition at line 382 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, DiagonalOp::imag, DiagonalOp::numElemsPerChunk, and DiagonalOp::real.
Referenced by syncDiagonalOp().
◆ copySharedReduceBlock()
Definition at line 1951 of file QuEST_gpu.cu.
References qreal, and reduceBlock().
Referenced by densmatr_calcExpecDiagonalOp(), densmatr_calcFidelity(), densmatr_calcHilbertSchmidtDistance(), densmatr_calcInnerProduct(), densmatr_calcPurity(), densmatr_findProbabilityOfZero(), statevec_calcExpecDiagonalOp(), statevec_calcInnerProduct(), and statevec_findProbabilityOfZero().
◆ densmatr_applyDiagonalOp()
void densmatr_applyDiagonalOp | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3240 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyDiagonalOp().
◆ densmatr_applyDiagonalOpKernel()
__global__ void densmatr_applyDiagonalOpKernel | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3217 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, DiagonalOp::numQubits, and qreal.
◆ densmatr_calcExpecDiagonalOp()
Complex densmatr_calcExpecDiagonalOp | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3412 of file QuEST_gpu.cu.
References copySharedReduceBlock(), DiagonalOp::deviceOperator, Qureg::deviceStateVec, Qureg::firstLevelReduction, Complex::imag, Qureg::numAmpsPerChunk, DiagonalOp::numQubits, qreal, Complex::real, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcExpecDiagonalOp().
◆ densmatr_calcExpecDiagonalOpKernel()
__global__ void densmatr_calcExpecDiagonalOpKernel | ( | int | getRealComp, |
qreal * | matReal, | ||
qreal * | matImag, | ||
qreal * | opReal, | ||
qreal * | opImag, | ||
int | numQubits, | ||
long long int | numTermsToSum, | ||
qreal * | reducedArray | ||
) |
if the thread represents a diagonal op, then it computes either a real or imag term of matr_{ii} op_i. Otherwise, it writes a 0 to the reduction array
Definition at line 3367 of file QuEST_gpu.cu.
References qreal, and reduceBlock().
◆ densmatr_calcFidelity()
Definition at line 2519 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::firstLevelReduction, Qureg::numQubitsRepresented, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcFidelity().
◆ densmatr_calcFidelityKernel()
__global__ void densmatr_calcFidelityKernel | ( | Qureg | dens, |
Qureg | vec, | ||
long long int | dim, | ||
qreal * | reducedArray | ||
) |
computes one term of (vec^*T) dens * vec
Definition at line 2481 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, qreal, and reduceBlock().
◆ densmatr_calcHilbertSchmidtDistance()
Definition at line 2593 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Qureg::numAmpsPerChunk, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcHilbertSchmidtDistance().
◆ densmatr_calcHilbertSchmidtDistanceSquaredKernel()
__global__ void densmatr_calcHilbertSchmidtDistanceSquaredKernel | ( | qreal * | aRe, |
qreal * | aIm, | ||
qreal * | bRe, | ||
qreal * | bIm, | ||
long long int | numAmpsToSum, | ||
qreal * | reducedArray | ||
) |
◆ densmatr_calcInnerProduct()
Definition at line 2313 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::firstLevelReduction, Qureg::numAmpsTotal, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcDensityInnerProduct().
◆ densmatr_calcInnerProductKernel()
__global__ void densmatr_calcInnerProductKernel | ( | Qureg | a, |
Qureg | b, | ||
long long int | numTermsToSum, | ||
qreal * | reducedArray | ||
) |
computes Tr(conjTrans(a) b) = sum of (a_ij^* b_ij), which is a real number
Definition at line 2292 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, qreal, and reduceBlock().
◆ densmatr_calcProbOfAllOutcomes()
void densmatr_calcProbOfAllOutcomes | ( | qreal * | outcomeProbs, |
Qureg | qureg, | ||
int * | qubits, | ||
int | numQubits | ||
) |
Definition at line 2259 of file QuEST_gpu.cu.
References Qureg::numQubitsRepresented, and qreal.
Referenced by calcProbOfAllOutcomes().
◆ densmatr_calcProbOfAllOutcomesKernel()
__global__ void densmatr_calcProbOfAllOutcomesKernel | ( | qreal * | outcomeProbs, |
Qureg | qureg, | ||
int * | qubits, | ||
int | numQubits | ||
) |
Definition at line 2238 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numQubitsRepresented, and qreal.
◆ densmatr_calcProbOfOutcome()
Definition at line 2158 of file QuEST_gpu.cu.
References densmatr_findProbabilityOfZero(), and qreal.
Referenced by calcProbOfOutcome(), collapseToOutcome(), and densmatr_measureWithStats().
◆ densmatr_calcPurity()
Computes the trace of the density matrix squared.
Definition at line 2664 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Qureg::numAmpsPerChunk, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcPurity().
◆ densmatr_calcPurityKernel()
__global__ void densmatr_calcPurityKernel | ( | qreal * | vecReal, |
qreal * | vecImag, | ||
long long int | numAmpsToSum, | ||
qreal * | reducedArray | ||
) |
◆ densmatr_calcTotalProb()
Definition at line 1632 of file QuEST_gpu.cu.
References copyStateFromGPU(), Qureg::numQubitsRepresented, qreal, and Qureg::stateVec.
Referenced by calcTotalProb(), and statevec_calcExpecPauliProd().
◆ densmatr_collapseToKnownProbOutcome()
void densmatr_collapseToKnownProbOutcome | ( | Qureg | qureg, |
int | measureQubit, | ||
int | outcome, | ||
qreal | outcomeProb | ||
) |
This involves finding |...i...><...j...| states and killing those where i!=j.
Renorms (/prob) every | * outcome * >< * outcome * | state, setting all others to zero.
Definition at line 2805 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by applyProjector(), collapseToOutcome(), and densmatr_measureWithStats().
◆ densmatr_collapseToKnownProbOutcomeKernel()
__global__ void densmatr_collapseToKnownProbOutcomeKernel | ( | qreal | outcomeProb, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numBasesToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | rowBit, | ||
long long int | colBit, | ||
long long int | desired, | ||
long long int | undesired | ||
) |
Maps thread ID to a |..0..><..0..| state and then locates |0><1|, |1><0| and |1><1|.
Definition at line 2779 of file QuEST_gpu.cu.
◆ densmatr_findProbabilityOfZero()
Definition at line 2064 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::firstLevelReduction, Qureg::numQubitsRepresented, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by densmatr_calcProbOfOutcome().
◆ densmatr_findProbabilityOfZeroKernel()
__global__ void densmatr_findProbabilityOfZeroKernel | ( | Qureg | qureg, |
int | measureQubit, | ||
qreal * | reducedArray | ||
) |
Definition at line 1960 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numQubitsRepresented, qreal, and reduceBlock().
◆ densmatr_initClassicalState()
void densmatr_initClassicalState | ( | Qureg | qureg, |
long long int | stateInd | ||
) |
Definition at line 258 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by initClassicalState().
◆ densmatr_initClassicalStateKernel()
__global__ void densmatr_initClassicalStateKernel | ( | long long int | densityNumElems, |
qreal * | densityReal, | ||
qreal * | densityImag, | ||
long long int | densityInd | ||
) |
Definition at line 239 of file QuEST_gpu.cu.
◆ densmatr_initPlusState()
void densmatr_initPlusState | ( | Qureg | qureg | ) |
Definition at line 226 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by initPlusState().
◆ densmatr_initPlusStateKernel()
__global__ void densmatr_initPlusStateKernel | ( | long long int | stateVecSize, |
qreal | probFactor, | ||
qreal * | stateVecReal, | ||
qreal * | stateVecImag | ||
) |
Definition at line 216 of file QuEST_gpu.cu.
◆ densmatr_initPureState()
Definition at line 205 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initPureState().
◆ densmatr_initPureStateKernel()
__global__ void densmatr_initPureStateKernel | ( | long long int | numPureAmps, |
qreal * | targetVecReal, | ||
qreal * | targetVecImag, | ||
qreal * | copyVecReal, | ||
qreal * | copyVecImag | ||
) |
◆ densmatr_mixDamping()
Definition at line 3048 of file QuEST_gpu.cu.
References densmatr_oneQubitDegradeOffDiagonal(), Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixDamping().
◆ densmatr_mixDampingKernel()
__global__ void densmatr_mixDampingKernel | ( | qreal | damping, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numAmpsToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | bothBits | ||
) |
Works like mixDephasing but modifies every other element, and elements are averaged in pairs.
Definition at line 3001 of file QuEST_gpu.cu.
References qreal.
◆ densmatr_mixDensityMatrix()
Definition at line 2846 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by mixDensityMatrix().
◆ densmatr_mixDensityMatrixKernel()
__global__ void densmatr_mixDensityMatrixKernel | ( | Qureg | combineQureg, |
qreal | otherProb, | ||
Qureg | otherQureg, | ||
long long int | numAmpsToVisit | ||
) |
◆ densmatr_mixDephasing()
Definition at line 2899 of file QuEST_gpu.cu.
References densmatr_oneQubitDegradeOffDiagonal(), and qreal.
Referenced by densmatr_mixDepolarising(), and mixDephasing().
◆ densmatr_mixDephasingKernel()
__global__ void densmatr_mixDephasingKernel | ( | qreal | fac, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numAmpsToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | colBit, | ||
long long int | rowBit | ||
) |
Called once for every 4 amplitudes in density matrix Works by establishing the |..0..><..0..| state (for its given index) then visiting |..1..><..0..| and |..0..><..1..|.
Labels |part1 X pa><rt2 NOT(X) part3| From the brain of Simon Benjamin
Definition at line 2863 of file QuEST_gpu.cu.
◆ densmatr_mixDepolarising()
Definition at line 3022 of file QuEST_gpu.cu.
References densmatr_mixDephasing(), Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixDepolarising().
◆ densmatr_mixDepolarisingKernel()
__global__ void densmatr_mixDepolarisingKernel | ( | qreal | depolLevel, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numAmpsToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | bothBits | ||
) |
Works like mixDephasing but modifies every other element, and elements are averaged in pairs.
Definition at line 2975 of file QuEST_gpu.cu.
References qreal.
◆ densmatr_mixTwoQubitDephasing()
Definition at line 2938 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by densmatr_mixTwoQubitDepolarising(), and mixTwoQubitDephasing().
◆ densmatr_mixTwoQubitDephasingKernel()
__global__ void densmatr_mixTwoQubitDephasingKernel | ( | qreal | fac, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numBackgroundStates, | ||
long long int | numAmpsToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | part4, | ||
long long int | part5, | ||
long long int | colBit1, | ||
long long int | rowBit1, | ||
long long int | colBit2, | ||
long long int | rowBit2 | ||
) |
Called 12 times for every 16 amplitudes in density matrix Each sums from the |..0..0..><..0..0..| index to visit either |..0..0..><..0..1..|, |..0..0..><..1..0..|, |..0..0..><..1..1..|, |..0..1..><..0..0..| etc and so on to |..1..1..><..1..0|.
Labels |part1 0 part2 0 par><t3 0 part4 0 part5|. From the brain of Simon Benjamin
Definition at line 2914 of file QuEST_gpu.cu.
◆ densmatr_mixTwoQubitDepolarising()
Definition at line 3108 of file QuEST_gpu.cu.
References densmatr_mixTwoQubitDephasing(), Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by mixTwoQubitDepolarising().
◆ densmatr_mixTwoQubitDepolarisingKernel()
__global__ void densmatr_mixTwoQubitDepolarisingKernel | ( | qreal | depolLevel, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
long long int | numAmpsToVisit, | ||
long long int | part1, | ||
long long int | part2, | ||
long long int | part3, | ||
long long int | part4, | ||
long long int | part5, | ||
long long int | rowCol1, | ||
long long int | rowCol2 | ||
) |
Called once for every 16 amplitudes.
Definition at line 3076 of file QuEST_gpu.cu.
References qreal.
◆ densmatr_oneQubitDegradeOffDiagonal()
Definition at line 2879 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, Qureg::numQubitsRepresented, and qreal.
Referenced by densmatr_mixDamping(), and densmatr_mixDephasing().
◆ extractBit()
__forceinline__ __device__ int extractBit | ( | const int | locationOfBitFromRight, |
const long long int | theEncodedNumber | ||
) |
Definition at line 82 of file QuEST_gpu.cu.
Referenced by agnostic_initDiagonalOpFromPauliHamil(), agnostic_initDiagonalOpFromPauliHamilKernel(), compressPairVectorForSingleQubitDepolarise(), compressPairVectorForTwoQubitDepolarise(), densmatr_calcProbOfAllOutcomesKernel(), densmatr_calcProbOfAllOutcomesLocal(), densmatr_collapseToKnownProbOutcome(), densmatr_findProbabilityOfZeroLocal(), densmatr_mixDampingDistributed(), densmatr_mixDepolarisingDistributed(), densmatr_mixTwoQubitDepolarisingDistributed(), densmatr_mixTwoQubitDepolarisingQ1LocalQ2DistributedPart3(), getGlobalIndOfOddParityInChunk(), statevec_applyMultiVarPhaseFuncOverrides(), statevec_applyMultiVarPhaseFuncOverridesKernel(), statevec_applyParamNamedPhaseFuncOverrides(), statevec_applyParamNamedPhaseFuncOverridesKernel(), statevec_applyPhaseFuncOverrides(), statevec_applyPhaseFuncOverridesKernel(), statevec_calcProbOfAllOutcomesKernel(), statevec_calcProbOfAllOutcomesLocal(), statevec_controlledCompactUnitaryDistributed(), statevec_controlledCompactUnitaryKernel(), statevec_controlledCompactUnitaryLocal(), statevec_controlledNotDistributed(), statevec_controlledNotKernel(), statevec_controlledNotLocal(), statevec_controlledPauliYDistributed(), statevec_controlledPauliYKernel(), statevec_controlledPauliYLocal(), statevec_controlledPhaseFlip(), statevec_controlledPhaseFlipKernel(), statevec_controlledPhaseShift(), statevec_controlledPhaseShiftKernel(), statevec_controlledUnitaryDistributed(), statevec_controlledUnitaryKernel(), statevec_controlledUnitaryLocal(), statevec_initStateOfSingleQubit(), statevec_initStateOfSingleQubitKernel(), statevec_multiControlledMultiQubitUnitaryKernel(), statevec_multiControlledMultiQubitUnitaryLocal(), and statevec_phaseShiftByTerm().
◆ flipBit()
__forceinline__ __device__ long long int flipBit | ( | const long long int | number, |
const int | bitInd | ||
) |
Definition at line 95 of file QuEST_gpu.cu.
Referenced by getGlobalIndOfOddParityInChunk(), statevec_multiControlledMultiQubitUnitary(), statevec_multiControlledMultiQubitUnitaryKernel(), statevec_multiControlledMultiQubitUnitaryLocal(), statevec_multiControlledTwoQubitUnitary(), statevec_multiControlledTwoQubitUnitaryKernel(), statevec_multiControlledTwoQubitUnitaryLocal(), statevec_swapQubitAmps(), statevec_swapQubitAmpsDistributed(), statevec_swapQubitAmpsKernel(), and statevec_swapQubitAmpsLocal().
◆ getBitMaskParity()
__forceinline__ __device__ int getBitMaskParity | ( | long long int | mask | ) |
Definition at line 86 of file QuEST_gpu.cu.
Referenced by statevec_multiControlledMultiRotateZKernel(), and statevec_multiRotateZKernel().
◆ getNumReductionLevels()
int getNumReductionLevels | ( | long long int | numValuesToReduce, |
int | numReducedPerLevel | ||
) |
Definition at line 2048 of file QuEST_gpu.cu.
◆ GPUExists()
int GPUExists | ( | void | ) |
◆ insertTwoZeroBits()
__forceinline__ __device__ long long int insertTwoZeroBits | ( | const long long int | number, |
const int | bit1, | ||
const int | bit2 | ||
) |
Definition at line 106 of file QuEST_gpu.cu.
References insertZeroBit().
Referenced by statevec_multiControlledTwoQubitUnitaryKernel(), statevec_multiControlledTwoQubitUnitaryLocal(), statevec_swapQubitAmpsKernel(), and statevec_swapQubitAmpsLocal().
◆ insertZeroBit()
__forceinline__ __device__ long long int insertZeroBit | ( | const long long int | number, |
const int | index | ||
) |
Definition at line 99 of file QuEST_gpu.cu.
Referenced by insertTwoZeroBits(), insertZeroBits(), and statevec_multiControlledMultiQubitUnitaryLocal().
◆ insertZeroBits()
__forceinline__ __device__ long long int insertZeroBits | ( | long long int | number, |
int * | inds, | ||
const int | numInds | ||
) |
Definition at line 112 of file QuEST_gpu.cu.
References insertZeroBit().
Referenced by statevec_multiControlledMultiQubitUnitaryKernel().
◆ log2Int()
__device__ __host__ unsigned int log2Int | ( | unsigned int | x | ) |
Definition at line 1925 of file QuEST_gpu.cu.
Referenced by reduceBlock().
◆ reduceBlock()
Definition at line 1932 of file QuEST_gpu.cu.
References log2Int().
Referenced by copySharedReduceBlock(), densmatr_calcExpecDiagonalOpKernel(), densmatr_calcFidelityKernel(), densmatr_calcHilbertSchmidtDistanceSquaredKernel(), densmatr_calcInnerProductKernel(), densmatr_calcPurityKernel(), densmatr_findProbabilityOfZeroKernel(), statevec_calcExpecDiagonalOpKernel(), statevec_calcInnerProductKernel(), and statevec_findProbabilityOfZeroKernel().
◆ statevec_applyDiagonalOp()
void statevec_applyDiagonalOp | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3209 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyDiagonalOp().
◆ statevec_applyDiagonalOpKernel()
__global__ void statevec_applyDiagonalOpKernel | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3187 of file QuEST_gpu.cu.
References DiagonalOp::deviceOperator, Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_applyMultiVarPhaseFuncOverrides()
void statevec_applyMultiVarPhaseFuncOverrides | ( | Qureg | qureg, |
int * | qubits, | ||
int * | numQubitsPerReg, | ||
int | numRegs, | ||
enum bitEncoding | encoding, | ||
qreal * | coeffs, | ||
qreal * | exponents, | ||
int * | numTermsPerReg, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
int | conj | ||
) |
Definition at line 3695 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyMultiVarPhaseFunc(), and applyMultiVarPhaseFuncOverrides().
◆ statevec_applyMultiVarPhaseFuncOverridesKernel()
__global__ void statevec_applyMultiVarPhaseFuncOverridesKernel | ( | Qureg | qureg, |
int * | qubits, | ||
int * | numQubitsPerReg, | ||
int | numRegs, | ||
enum bitEncoding | encoding, | ||
qreal * | coeffs, | ||
qreal * | exponents, | ||
int * | numTermsPerReg, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
long long int * | phaseInds, | ||
int | conj | ||
) |
Definition at line 3611 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, qreal, TWOS_COMPLEMENT, and UNSIGNED.
◆ statevec_applyParamNamedPhaseFuncOverrides()
void statevec_applyParamNamedPhaseFuncOverrides | ( | Qureg | qureg, |
int * | qubits, | ||
int * | numQubitsPerReg, | ||
int | numRegs, | ||
enum bitEncoding | encoding, | ||
enum phaseFunc | phaseFuncName, | ||
qreal * | params, | ||
int | numParams, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
int | conj | ||
) |
Definition at line 3909 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by agnostic_applyQFT(), applyNamedPhaseFunc(), applyNamedPhaseFuncOverrides(), applyParamNamedPhaseFunc(), and applyParamNamedPhaseFuncOverrides().
◆ statevec_applyParamNamedPhaseFuncOverridesKernel()
__global__ void statevec_applyParamNamedPhaseFuncOverridesKernel | ( | Qureg | qureg, |
int * | qubits, | ||
int * | numQubitsPerReg, | ||
int | numRegs, | ||
enum bitEncoding | encoding, | ||
enum phaseFunc | phaseFuncName, | ||
qreal * | params, | ||
int | numParams, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
long long int * | phaseInds, | ||
int | conj | ||
) |
Definition at line 3760 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, DISTANCE, extractBit(), INVERSE_DISTANCE, INVERSE_NORM, INVERSE_PRODUCT, NORM, Qureg::numAmpsPerChunk, PRODUCT, qreal, SCALED_DISTANCE, SCALED_INVERSE_DISTANCE, SCALED_INVERSE_NORM, SCALED_INVERSE_PRODUCT, SCALED_INVERSE_SHIFTED_DISTANCE, SCALED_INVERSE_SHIFTED_NORM, SCALED_NORM, SCALED_PRODUCT, TWOS_COMPLEMENT, and UNSIGNED.
◆ statevec_applyPhaseFuncOverrides()
void statevec_applyPhaseFuncOverrides | ( | Qureg | qureg, |
int * | qubits, | ||
int | numQubits, | ||
enum bitEncoding | encoding, | ||
qreal * | coeffs, | ||
qreal * | exponents, | ||
int | numTerms, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
int | conj | ||
) |
Definition at line 3576 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyPhaseFunc(), and applyPhaseFuncOverrides().
◆ statevec_applyPhaseFuncOverridesKernel()
__global__ void statevec_applyPhaseFuncOverridesKernel | ( | Qureg | qureg, |
int * | qubits, | ||
int | numQubits, | ||
enum bitEncoding | encoding, | ||
qreal * | coeffs, | ||
qreal * | exponents, | ||
int | numTerms, | ||
long long int * | overrideInds, | ||
qreal * | overridePhases, | ||
int | numOverrides, | ||
int | conj | ||
) |
Definition at line 3522 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, qreal, TWOS_COMPLEMENT, and UNSIGNED.
◆ statevec_calcExpecDiagonalOp()
Complex statevec_calcExpecDiagonalOp | ( | Qureg | qureg, |
DiagonalOp | op | ||
) |
Definition at line 3276 of file QuEST_gpu.cu.
References copySharedReduceBlock(), DiagonalOp::deviceOperator, Qureg::deviceStateVec, Qureg::firstLevelReduction, Complex::imag, Qureg::numAmpsPerChunk, qreal, Complex::real, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcExpecDiagonalOp().
◆ statevec_calcExpecDiagonalOpKernel()
__global__ void statevec_calcExpecDiagonalOpKernel | ( | int | getRealComp, |
qreal * | vecReal, | ||
qreal * | vecImag, | ||
qreal * | opReal, | ||
qreal * | opImag, | ||
long long int | numTermsToSum, | ||
qreal * | reducedArray | ||
) |
computes either a real or imag term of |vec_i|^2 op_i
Definition at line 3249 of file QuEST_gpu.cu.
References qreal, and reduceBlock().
◆ 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 2393 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::deviceStateVec, Qureg::firstLevelReduction, Complex::imag, Qureg::numAmpsPerChunk, qreal, Complex::real, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by calcInnerProduct(), statevec_calcExpecPauliProd(), and statevec_calcFidelity().
◆ statevec_calcInnerProductKernel()
__global__ void statevec_calcInnerProductKernel | ( | int | getRealComp, |
qreal * | vecReal1, | ||
qreal * | vecImag1, | ||
qreal * | vecReal2, | ||
qreal * | vecImag2, | ||
long long int | numTermsToSum, | ||
qreal * | reducedArray | ||
) |
computes either a real or imag term in the inner product
Definition at line 2363 of file QuEST_gpu.cu.
References qreal, and reduceBlock().
◆ statevec_calcProbOfAllOutcomes()
void statevec_calcProbOfAllOutcomes | ( | qreal * | outcomeProbs, |
Qureg | qureg, | ||
int * | qubits, | ||
int | numQubits | ||
) |
Definition at line 2207 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by calcProbOfAllOutcomes().
◆ statevec_calcProbOfAllOutcomesKernel()
__global__ void statevec_calcProbOfAllOutcomesKernel | ( | qreal * | outcomeProbs, |
Qureg | qureg, | ||
int * | qubits, | ||
int | numQubits | ||
) |
Definition at line 2186 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsTotal, and qreal.
◆ statevec_calcProbOfOutcome()
Definition at line 2150 of file QuEST_gpu.cu.
References qreal, and statevec_findProbabilityOfZero().
Referenced by calcProbOfOutcome(), collapseToOutcome(), and statevec_measureWithStats().
◆ statevec_calcTotalProb()
Definition at line 1655 of file QuEST_gpu.cu.
References copyStateFromGPU(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by calcTotalProb().
◆ statevec_cloneQureg()
works for both statevectors and density matrices
Definition at line 170 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, and Qureg::numAmpsPerChunk.
Referenced by cloneQureg(), createCloneQureg(), initPureState(), and statevec_calcExpecPauliProd().
◆ statevec_collapseToKnownProbOutcome()
void statevec_collapseToKnownProbOutcome | ( | Qureg | qureg, |
int | measureQubit, | ||
int | outcome, | ||
qreal | outcomeProb | ||
) |
Definition at line 2770 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyProjector(), collapseToOutcome(), and statevec_measureWithStats().
◆ statevec_collapseToKnownProbOutcomeKernel()
__global__ void statevec_collapseToKnownProbOutcomeKernel | ( | Qureg | qureg, |
int | measureQubit, | ||
int | outcome, | ||
qreal | totalProbability | ||
) |
Definition at line 2713 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_compactUnitary()
Definition at line 844 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by compactUnitary(), statevec_multiRotatePauli(), statevec_rotateAroundAxis(), and statevec_rotateAroundAxisConj().
◆ statevec_compactUnitaryKernel()
__global__ void statevec_compactUnitaryKernel | ( | Qureg | qureg, |
int | rotQubit, | ||
Complex | alpha, | ||
Complex | beta | ||
) |
fix – no necessary for GPU version
Definition at line 789 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Complex::imag, Qureg::numAmpsPerChunk, qreal, and Complex::real.
◆ statevec_compareStates()
Definition at line 771 of file QuEST_gpu.cu.
References copyStateFromGPU(), Qureg::numAmpsPerChunk, qreal, and Qureg::stateVec.
Referenced by compareStates().
◆ statevec_controlledCompactUnitary()
void statevec_controlledCompactUnitary | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
Complex | alpha, | ||
Complex | beta | ||
) |
Definition at line 911 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledCompactUnitary(), statevec_controlledRotateAroundAxis(), and statevec_controlledRotateAroundAxisConj().
◆ statevec_controlledCompactUnitaryKernel()
__global__ void statevec_controlledCompactUnitaryKernel | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
Complex | alpha, | ||
Complex | beta | ||
) |
fix – no necessary for GPU version
Definition at line 852 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Complex::imag, Qureg::numAmpsPerChunk, qreal, and Complex::real.
◆ statevec_controlledNot()
void statevec_controlledNot | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit | ||
) |
Definition at line 1873 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledNot().
◆ statevec_controlledNotKernel()
__global__ void statevec_controlledNotKernel | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit | ||
) |
Definition at line 1834 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_controlledPauliY()
void statevec_controlledPauliY | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit | ||
) |
Definition at line 1445 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledPauliY().
◆ statevec_controlledPauliYConj()
void statevec_controlledPauliYConj | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit | ||
) |
Definition at line 1454 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledPauliY().
◆ statevec_controlledPauliYKernel()
__global__ void statevec_controlledPauliYKernel | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
int | conjFac | ||
) |
Definition at line 1409 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_controlledPhaseFlip()
void statevec_controlledPhaseFlip | ( | Qureg | qureg, |
int | idQubit1, | ||
int | idQubit2 | ||
) |
Definition at line 1708 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledPhaseFlip().
◆ statevec_controlledPhaseFlipKernel()
__global__ void statevec_controlledPhaseFlipKernel | ( | Qureg | qureg, |
int | idQubit1, | ||
int | idQubit2 | ||
) |
Definition at line 1687 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_controlledPhaseShift()
Definition at line 1527 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledPhaseShift().
◆ statevec_controlledPhaseShiftKernel()
__global__ void statevec_controlledPhaseShiftKernel | ( | Qureg | qureg, |
int | idQubit1, | ||
int | idQubit2, | ||
qreal | cosAngle, | ||
qreal | sinAngle | ||
) |
Definition at line 1502 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_controlledUnitary()
void statevec_controlledUnitary | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
ComplexMatrix2 | u | ||
) |
Definition at line 1237 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by controlledUnitary().
◆ statevec_controlledUnitaryKernel()
__global__ void statevec_controlledUnitaryKernel | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
ArgMatrix2 | u | ||
) |
fix – no necessary for GPU version
Definition at line 1179 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_createQureg()
Definition at line 275 of file QuEST_gpu.cu.
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 321 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::firstLevelReduction, QuESTEnv::numRanks, Qureg::pairStateVec, Qureg::secondLevelReduction, and Qureg::stateVec.
Referenced by destroyQureg().
◆ statevec_findProbabilityOfZero()
Definition at line 2112 of file QuEST_gpu.cu.
References copySharedReduceBlock(), Qureg::firstLevelReduction, Qureg::numAmpsPerChunk, qreal, REDUCE_SHARED_SIZE, Qureg::secondLevelReduction, and swapDouble().
Referenced by statevec_calcProbOfOutcome().
◆ statevec_findProbabilityOfZeroKernel()
__global__ void statevec_findProbabilityOfZeroKernel | ( | Qureg | qureg, |
int | measureQubit, | ||
qreal * | reducedArray | ||
) |
Definition at line 1998 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, qreal, and reduceBlock().
◆ statevec_getImagAmp()
Definition at line 576 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, and qreal.
Referenced by getAmp(), getDensityAmp(), getImagAmp(), and statevec_getProbAmp().
◆ statevec_getRealAmp()
Definition at line 569 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, and qreal.
Referenced by getAmp(), getDensityAmp(), getRealAmp(), and statevec_getProbAmp().
◆ statevec_hadamard()
void statevec_hadamard | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 1826 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by agnostic_applyQFT(), and hadamard().
◆ statevec_hadamardKernel()
__global__ void statevec_hadamardKernel | ( | Qureg | qureg, |
int | targetQubit | ||
) |
fix – no necessary for GPU version
Definition at line 1777 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_initBlankState()
void statevec_initBlankState | ( | Qureg | qureg | ) |
Definition at line 593 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initBlankState(), and statevec_applyPauliSum().
◆ statevec_initBlankStateKernel()
__global__ void statevec_initBlankStateKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag | ||
) |
Definition at line 583 of file QuEST_gpu.cu.
◆ statevec_initClassicalState()
void statevec_initClassicalState | ( | Qureg | qureg, |
long long int | stateInd | ||
) |
Definition at line 668 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initClassicalState().
◆ statevec_initClassicalStateKernel()
__global__ void statevec_initClassicalStateKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag, | ||
long long int | stateInd | ||
) |
Definition at line 653 of file QuEST_gpu.cu.
◆ 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 689 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initDebugState().
◆ statevec_initDebugStateKernel()
__global__ void statevec_initDebugStateKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag | ||
) |
Definition at line 679 of file QuEST_gpu.cu.
◆ statevec_initPlusState()
void statevec_initPlusState | ( | Qureg | qureg | ) |
Definition at line 642 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initPlusState().
◆ statevec_initPlusStateKernel()
__global__ void statevec_initPlusStateKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag | ||
) |
◆ statevec_initStateFromSingleFile()
Definition at line 727 of file QuEST_gpu.cu.
References Qureg::chunkId, copyStateToGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, qreal, and Qureg::stateVec.
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] outcome of qubit 'qubitId'
Definition at line 718 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initStateOfSingleQubit().
◆ statevec_initStateOfSingleQubitKernel()
__global__ void statevec_initStateOfSingleQubitKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag, | ||
int | qubitId, | ||
int | outcome | ||
) |
◆ statevec_initZeroState()
void statevec_initZeroState | ( | Qureg | qureg | ) |
Definition at line 620 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
Referenced by initZeroState().
◆ statevec_initZeroStateKernel()
__global__ void statevec_initZeroStateKernel | ( | long long int | stateVecSize, |
qreal * | stateVecReal, | ||
qreal * | stateVecImag | ||
) |
Definition at line 604 of file QuEST_gpu.cu.
◆ statevec_multiControlledMultiQubitNot()
void statevec_multiControlledMultiQubitNot | ( | Qureg | qureg, |
int | ctrlMask, | ||
int | targMask | ||
) |
Definition at line 1918 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by multiControlledMultiQubitNot(), and multiQubitNot().
◆ statevec_multiControlledMultiQubitNotKernel()
__global__ void statevec_multiControlledMultiQubitNotKernel | ( | Qureg | qureg, |
int | ctrlMask, | ||
int | targMask | ||
) |
Definition at line 1881 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledMultiQubitUnitary()
void statevec_multiControlledMultiQubitUnitary | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
int * | targs, | ||
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 1039 of file QuEST_gpu.cu.
References ComplexMatrixN::imag, Qureg::numAmpsPerChunk, ComplexMatrixN::numQubits, qreal, and ComplexMatrixN::real.
Referenced by applyMultiControlledMatrixN(), densmatr_applyMultiQubitKrausSuperoperator(), densmatr_applyTwoQubitKrausSuperoperator(), multiControlledMultiQubitUnitary(), statevec_controlledMultiQubitUnitary(), and statevec_multiQubitUnitary().
◆ statevec_multiControlledMultiQubitUnitaryKernel()
__global__ void statevec_multiControlledMultiQubitUnitaryKernel | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
int * | targs, | ||
int | numTargs, | ||
qreal * | uRe, | ||
qreal * | uIm, | ||
long long int * | ampInds, | ||
qreal * | reAmps, | ||
qreal * | imAmps, | ||
long long int | numTargAmps | ||
) |
Definition at line 980 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, extractBit(), flipBit(), insertZeroBits(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledMultiRotateZ()
void statevec_multiControlledMultiRotateZ | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
long long int | targMask, | ||
qreal | angle | ||
) |
Definition at line 1621 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by multiControlledMultiRotateZ(), and statevec_multiControlledMultiRotatePauli().
◆ statevec_multiControlledMultiRotateZKernel()
__global__ void statevec_multiControlledMultiRotateZKernel | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
long long int | targMask, | ||
qreal | cosAngle, | ||
qreal | sinAngle | ||
) |
Definition at line 1599 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, getBitMaskParity(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledPhaseFlip()
void statevec_multiControlledPhaseFlip | ( | Qureg | qureg, |
int * | controlQubits, | ||
int | numControlQubits | ||
) |
Definition at line 1734 of file QuEST_gpu.cu.
References getQubitBitMask(), Qureg::numAmpsPerChunk, and qreal.
Referenced by multiControlledPhaseFlip().
◆ statevec_multiControlledPhaseFlipKernel()
__global__ void statevec_multiControlledPhaseFlipKernel | ( | Qureg | qureg, |
long long int | mask | ||
) |
Definition at line 1716 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledPhaseShift()
void statevec_multiControlledPhaseShift | ( | Qureg | qureg, |
int * | controlQubits, | ||
int | numControlQubits, | ||
qreal | angle | ||
) |
Definition at line 1558 of file QuEST_gpu.cu.
References getQubitBitMask(), Qureg::numAmpsPerChunk, and qreal.
Referenced by multiControlledPhaseShift().
◆ statevec_multiControlledPhaseShiftKernel()
__global__ void statevec_multiControlledPhaseShiftKernel | ( | Qureg | qureg, |
long long int | mask, | ||
qreal | cosAngle, | ||
qreal | sinAngle | ||
) |
Definition at line 1538 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledTwoQubitUnitary()
void statevec_multiControlledTwoQubitUnitary | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
int | q1, | ||
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.
the double swap (q1,q2 to 0,1) may be possible simultaneously by a bespoke swap routine.
Definition at line 1172 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by densmatr_applyKrausSuperoperator(), multiControlledTwoQubitUnitary(), statevec_controlledTwoQubitUnitary(), and statevec_twoQubitUnitary().
◆ statevec_multiControlledTwoQubitUnitaryKernel()
__global__ void statevec_multiControlledTwoQubitUnitaryKernel | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
int | q1, | ||
int | q2, | ||
ArgMatrix4 | u | ||
) |
Definition at line 1096 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, flipBit(), insertTwoZeroBits(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiControlledUnitary()
void statevec_multiControlledUnitary | ( | Qureg | qureg, |
long long int | ctrlQubitsMask, | ||
long long int | ctrlFlipMask, | ||
int | targetQubit, | ||
ComplexMatrix2 | u | ||
) |
Definition at line 1305 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by multiControlledUnitary(), multiStateControlledUnitary(), and statevec_multiControlledMultiRotatePauli().
◆ statevec_multiControlledUnitaryKernel()
__global__ void statevec_multiControlledUnitaryKernel | ( | Qureg | qureg, |
long long int | ctrlQubitsMask, | ||
long long int | ctrlFlipMask, | ||
int | targetQubit, | ||
ArgMatrix2 | u | ||
) |
fix – no necessary for GPU version
Definition at line 1245 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_multiRotateZ()
Definition at line 1588 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by multiRotateZ(), and statevec_multiRotatePauli().
◆ statevec_multiRotateZKernel()
__global__ void statevec_multiRotateZKernel | ( | Qureg | qureg, |
long long int | mask, | ||
qreal | cosAngle, | ||
qreal | sinAngle | ||
) |
Definition at line 1571 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, getBitMaskParity(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_pauliX()
void statevec_pauliX | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 1360 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by pauliX(), and statevec_applyPauliProd().
◆ statevec_pauliXKernel()
__global__ void statevec_pauliXKernel | ( | Qureg | qureg, |
int | targetQubit | ||
) |
fix – no necessary for GPU version
Definition at line 1316 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_pauliY()
void statevec_pauliY | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 1393 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by pauliY(), and statevec_applyPauliProd().
◆ statevec_pauliYConj()
void statevec_pauliYConj | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 1401 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by pauliY().
◆ statevec_pauliYKernel()
__global__ void statevec_pauliYKernel | ( | Qureg | qureg, |
int | targetQubit, | ||
int | conjFac | ||
) |
Definition at line 1368 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ statevec_phaseShiftByTerm()
Definition at line 1491 of file QuEST_gpu.cu.
References Complex::imag, Qureg::numAmpsPerChunk, qreal, and Complex::real.
Referenced by statevec_pauliZ(), statevec_phaseShift(), statevec_sGate(), statevec_sGateConj(), statevec_tGate(), and statevec_tGateConj().
◆ statevec_phaseShiftByTermKernel()
__global__ void statevec_phaseShiftByTermKernel | ( | Qureg | qureg, |
int | targetQubit, | ||
qreal | cosAngle, | ||
qreal | sinAngle | ||
) |
Definition at line 1463 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ 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 543 of file QuEST_gpu.cu.
References Qureg::chunkId, copyStateFromGPU(), Qureg::numAmpsPerChunk, Qureg::numChunks, Qureg::numQubitsInStateVec, Qureg::stateVec, and syncQuESTEnv().
Referenced by reportStateToScreen().
◆ statevec_setAmps()
void statevec_setAmps | ( | Qureg | qureg, |
long long int | startInd, | ||
qreal * | reals, | ||
qreal * | imags, | ||
long long int | numAmps | ||
) |
Definition at line 153 of file QuEST_gpu.cu.
References Qureg::deviceStateVec.
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 3175 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by setWeightedQureg(), and statevec_applyPauliSum().
◆ statevec_setWeightedQuregKernel()
__global__ void statevec_setWeightedQuregKernel | ( | Complex | fac1, |
Qureg | qureg1, | ||
Complex | fac2, | ||
Qureg | qureg2, | ||
Complex | facOut, | ||
Qureg | out | ||
) |
Definition at line 3143 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Complex::imag, Qureg::numAmpsPerChunk, qreal, and Complex::real.
◆ statevec_swapQubitAmps()
void statevec_swapQubitAmps | ( | Qureg | qureg, |
int | qb1, | ||
int | qb2 | ||
) |
Definition at line 1769 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by agnostic_applyQFT(), and swapGate().
◆ statevec_swapQubitAmpsKernel()
__global__ void statevec_swapQubitAmpsKernel | ( | Qureg | qureg, |
int | qb1, | ||
int | qb2 | ||
) |
Definition at line 1743 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, flipBit(), insertTwoZeroBits(), Qureg::numAmpsPerChunk, and qreal.
◆ statevec_unitary()
void statevec_unitary | ( | Qureg | qureg, |
int | targetQubit, | ||
ComplexMatrix2 | u | ||
) |
Definition at line 972 of file QuEST_gpu.cu.
References Qureg::numAmpsPerChunk, and qreal.
Referenced by applyMatrix2(), and unitary().
◆ statevec_unitaryKernel()
__global__ void statevec_unitaryKernel | ( | Qureg | qureg, |
int | targetQubit, | ||
ArgMatrix2 | u | ||
) |
fix – no necessary for GPU version
Definition at line 919 of file QuEST_gpu.cu.
References Qureg::deviceStateVec, Qureg::numAmpsPerChunk, and qreal.
◆ swapDouble()
Definition at line 2057 of file QuEST_gpu.cu.
References qreal.
Referenced by densmatr_calcExpecDiagonalOp(), densmatr_calcFidelity(), densmatr_calcHilbertSchmidtDistance(), densmatr_calcInnerProduct(), densmatr_calcPurity(), densmatr_findProbabilityOfZero(), statevec_calcExpecDiagonalOp(), statevec_calcInnerProduct(), and statevec_findProbabilityOfZero().