#include "QuEST.h"
#include "QuEST_internal.h"
#include "QuEST_precision.h"
#include "QuEST_validation.h"
#include "QuEST_qasm.h"
#include "mt19937ar.h"
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | M_PI 3.1415926535897932384626433832795028841971 |
#define | macro_allocStackComplexMatrixN(matrix, numQubits) |
#define | macro_initialiseStackComplexMatrixN(matrix, numQubits, real, imag) |
#define | macro_populateKrausOperator(superOp, ops, numOps, opDim) |
#define | macro_setConjugateMatrix(dest, src, dim) |
Functions | |
void | agnostic_applyQFT (Qureg qureg, int *qubits, int numQubits) |
void | agnostic_applyTrotterCircuit (Qureg qureg, PauliHamil hamil, qreal time, int order, int reps) |
void | applyExponentiatedPauliHamil (Qureg qureg, PauliHamil hamil, qreal fac, int reverse) |
void | applySymmetrizedTrotterCircuit (Qureg qureg, PauliHamil hamil, qreal time, int order) |
ComplexMatrixN | bindArraysToStackComplexMatrixN (int numQubits, qreal re[][1<< numQubits], qreal im[][1<< numQubits], qreal **reStorage, qreal **imStorage) |
void | densmatr_applyKrausSuperoperator (Qureg qureg, int target, ComplexMatrix4 superOp) |
void | densmatr_applyMultiQubitKrausSuperoperator (Qureg qureg, int *targets, int numTargets, ComplexMatrixN superOp) |
void | densmatr_applyTwoQubitKrausSuperoperator (Qureg qureg, int target1, int target2, ComplexMatrixN superOp) |
int | densmatr_measureWithStats (Qureg qureg, int measureQubit, qreal *outcomeProb) |
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 probX, qreal probY, qreal probZ) |
void | densmatr_mixTwoQubitKrausMap (Qureg qureg, int target1, int target2, ComplexMatrix4 *ops, int numOps) |
void | ensureIndsIncrease (int *ind1, int *ind2) |
int | generateMeasurementOutcome (qreal zeroProb, qreal *outcomeProb) |
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, int numControlQubits) |
long long int | getQubitBitMask (int *qubits, int numQubits) |
void | getQuESTDefaultSeedKey (unsigned long int *key) |
Vector | getUnitVector (Vector vec) |
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 | populateKrausSuperOperator2 (ComplexMatrix4 *superOp, ComplexMatrix2 *ops, int numOps) |
void | populateKrausSuperOperator4 (ComplexMatrixN *superOp, ComplexMatrix4 *ops, int numOps) |
void | populateKrausSuperOperatorN (ComplexMatrixN *superOp, ComplexMatrixN *ops, int numOps) |
void | reportQuregParams (Qureg qureg) |
Report metainformation about a set of qubits: number of qubits, number of probability amplitudes. More... | |
void | reportState (Qureg qureg) |
Print the current state vector of probability amplitudes for a set of qubits to file. More... | |
void | setConjugateMatrixN (ComplexMatrixN m) |
void | shiftIndices (int *indices, int numIndices, int shift) |
void | shiftSubregIndices (int *allInds, int *numIndsPerReg, int numRegs, int shift) |
void | statevec_applyPauliProd (Qureg workspace, int *targetQubits, enum pauliOpType *pauliCodes, int numTargets) |
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) |
void | statevec_controlledMultiQubitUnitary (Qureg qureg, int ctrl, int *targets, int numTargets, ComplexMatrixN u) |
void | statevec_controlledRotateAroundAxis (Qureg qureg, int controlQubit, int targetQubit, qreal angle, Vector axis) |
void | statevec_controlledRotateAroundAxisConj (Qureg qureg, int controlQubit, int targetQubit, qreal angle, Vector axis) |
void | statevec_controlledRotateX (Qureg qureg, int controlQubit, int targetQubit, qreal angle) |
void | statevec_controlledRotateY (Qureg qureg, int controlQubit, int targetQubit, qreal angle) |
void | statevec_controlledRotateZ (Qureg qureg, int controlQubit, int targetQubit, qreal angle) |
void | statevec_controlledTwoQubitUnitary (Qureg qureg, int controlQubit, int targetQubit1, int targetQubit2, ComplexMatrix4 u) |
qreal | statevec_getProbAmp (Qureg qureg, long long int index) |
int | statevec_measureWithStats (Qureg qureg, int measureQubit, qreal *outcomeProb) |
void | statevec_multiControlledMultiRotatePauli (Qureg qureg, long long int ctrlMask, int *targetQubits, enum pauliOpType *targetPaulis, int numTargets, qreal angle, int applyConj) |
void | statevec_multiQubitUnitary (Qureg qureg, int *targets, 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_pauliZ (Qureg qureg, int targetQubit) |
void | statevec_phaseShift (Qureg qureg, int targetQubit, qreal angle) |
void | statevec_rotateAroundAxis (Qureg qureg, int rotQubit, qreal angle, Vector axis) |
void | statevec_rotateAroundAxisConj (Qureg qureg, int rotQubit, qreal angle, Vector axis) |
void | statevec_rotateX (Qureg qureg, int rotQubit, qreal angle) |
void | statevec_rotateY (Qureg qureg, int rotQubit, qreal angle) |
void | statevec_rotateZ (Qureg qureg, int rotQubit, qreal angle) |
void | statevec_sGate (Qureg qureg, int targetQubit) |
void | statevec_sGateConj (Qureg qureg, int targetQubit) |
void | statevec_sqrtSwapGate (Qureg qureg, int qb1, int qb2) |
void | statevec_sqrtSwapGateConj (Qureg qureg, int qb1, int qb2) |
void | statevec_tGate (Qureg qureg, int targetQubit) |
void | statevec_tGateConj (Qureg qureg, int targetQubit) |
void | statevec_twoQubitUnitary (Qureg qureg, int targetQubit1, int targetQubit2, ComplexMatrix4 u) |
Detailed Description
Internal and API functions which are hardware-agnostic. These must never call a front-end function in QuEST.c, which would lead to duplication of e.g. QASM logging and validation. Note that though many of these functions are prefixed with statevec_, they will be called multiple times to effect their equivalent operation on density matrices, so the passed Qureg can be assumed a statevector. Functions prefixed with densmatr_ may still explicitly call statevec_ functions, but will need to manually apply the conjugate qubit-shifted operations to satisfy the Choi–Jamiolkowski isomorphism
Definition in file QuEST_common.c.
Macro Definition Documentation
◆ M_PI
#define M_PI 3.1415926535897932384626433832795028841971 |
Definition at line 41 of file QuEST_common.c.
◆ macro_allocStackComplexMatrixN
#define macro_allocStackComplexMatrixN | ( | matrix, | |
numQubits | |||
) |
Definition at line 675 of file QuEST_common.c.
◆ macro_initialiseStackComplexMatrixN
#define macro_initialiseStackComplexMatrixN | ( | matrix, | |
numQubits, | |||
real, | |||
imag | |||
) |
Definition at line 669 of file QuEST_common.c.
◆ macro_populateKrausOperator
#define macro_populateKrausOperator | ( | superOp, | |
ops, | |||
numOps, | |||
opDim | |||
) |
Definition at line 585 of file QuEST_common.c.
◆ macro_setConjugateMatrix
#define macro_setConjugateMatrix | ( | dest, | |
src, | |||
dim | |||
) |
Definition at line 99 of file QuEST_common.c.
Function Documentation
◆ agnostic_applyQFT()
void agnostic_applyQFT | ( | Qureg | qureg, |
int * | qubits, | ||
int | numQubits | ||
) |
Definition at line 849 of file QuEST_common.c.
References GATE_HADAMARD, GATE_SWAP, Qureg::isDensityMatrix, M_PI, Qureg::numQubitsRepresented, qasm_recordControlledGate(), qasm_recordGate(), qasm_recordNamedPhaseFunc(), qreal, SCALED_PRODUCT, shiftSubregIndices(), statevec_applyParamNamedPhaseFuncOverrides(), statevec_hadamard(), statevec_swapQubitAmps(), and UNSIGNED.
Referenced by applyFullQFT(), and applyQFT().
◆ agnostic_applyTrotterCircuit()
void agnostic_applyTrotterCircuit | ( | Qureg | qureg, |
PauliHamil | hamil, | ||
qreal | time, | ||
int | order, | ||
int | reps | ||
) |
Definition at line 840 of file QuEST_common.c.
References applySymmetrizedTrotterCircuit().
Referenced by applyTrotterCircuit().
◆ applyExponentiatedPauliHamil()
void applyExponentiatedPauliHamil | ( | Qureg | qureg, |
PauliHamil | hamil, | ||
qreal | fac, | ||
int | reverse | ||
) |
Definition at line 765 of file QuEST_common.c.
References Qureg::isDensityMatrix, PauliHamil::numQubits, PauliHamil::numSumTerms, PAULI_X, PAULI_Y, PAULI_Z, PauliHamil::pauliCodes, qasm_recordComment(), qreal, statevec_multiRotatePauli(), and PauliHamil::termCoeffs.
Referenced by applySymmetrizedTrotterCircuit().
◆ applySymmetrizedTrotterCircuit()
void applySymmetrizedTrotterCircuit | ( | Qureg | qureg, |
PauliHamil | hamil, | ||
qreal | time, | ||
int | order | ||
) |
Definition at line 820 of file QuEST_common.c.
References applyExponentiatedPauliHamil(), and qreal.
Referenced by agnostic_applyTrotterCircuit().
◆ bindArraysToStackComplexMatrixN()
ComplexMatrixN bindArraysToStackComplexMatrixN | ( | int | numQubits, |
qreal | re[][1<< numQubits], | ||
qreal | im[][1<< numQubits], | ||
qreal ** | reStorage, | ||
qreal ** | imStorage | ||
) |
Definition at line 652 of file QuEST_common.c.
References ComplexMatrixN::imag, ComplexMatrixN::numQubits, and ComplexMatrixN::real.
◆ densmatr_applyKrausSuperoperator()
void densmatr_applyKrausSuperoperator | ( | Qureg | qureg, |
int | target, | ||
ComplexMatrix4 | superOp | ||
) |
Definition at line 620 of file QuEST_common.c.
References Qureg::numQubitsRepresented, and statevec_multiControlledTwoQubitUnitary().
Referenced by densmatr_mixKrausMap().
◆ densmatr_applyMultiQubitKrausSuperoperator()
void densmatr_applyMultiQubitKrausSuperoperator | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
ComplexMatrixN | superOp | ||
) |
Definition at line 634 of file QuEST_common.c.
References Qureg::numQubitsRepresented, and statevec_multiControlledMultiQubitUnitary().
Referenced by densmatr_mixMultiQubitKrausMap().
◆ densmatr_applyTwoQubitKrausSuperoperator()
void densmatr_applyTwoQubitKrausSuperoperator | ( | Qureg | qureg, |
int | target1, | ||
int | target2, | ||
ComplexMatrixN | superOp | ||
) |
Definition at line 626 of file QuEST_common.c.
References Qureg::numQubitsRepresented, and statevec_multiControlledMultiQubitUnitary().
Referenced by densmatr_mixTwoQubitKrausMap().
◆ densmatr_measureWithStats()
Definition at line 372 of file QuEST_common.c.
References densmatr_calcProbOfOutcome(), densmatr_collapseToKnownProbOutcome(), generateMeasurementOutcome(), and qreal.
Referenced by measure(), and measureWithStats().
◆ densmatr_mixKrausMap()
void densmatr_mixKrausMap | ( | Qureg | qureg, |
int | target, | ||
ComplexMatrix2 * | ops, | ||
int | numOps | ||
) |
Definition at line 644 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 701 of file QuEST_common.c.
References createComplexMatrixN(), densmatr_applyMultiQubitKrausSuperoperator(), destroyComplexMatrixN(), macro_allocStackComplexMatrixN, and populateKrausSuperOperatorN().
Referenced by mixMultiQubitKrausMap().
◆ densmatr_mixPauli()
Definition at line 743 of file QuEST_common.c.
References densmatr_mixKrausMap(), ComplexMatrix2::imag, qreal, and ComplexMatrix2::real.
Referenced by mixPauli().
◆ densmatr_mixTwoQubitKrausMap()
void densmatr_mixTwoQubitKrausMap | ( | Qureg | qureg, |
int | target1, | ||
int | target2, | ||
ComplexMatrix4 * | ops, | ||
int | numOps | ||
) |
Definition at line 682 of file QuEST_common.c.
References createComplexMatrixN(), densmatr_applyTwoQubitKrausSuperoperator(), destroyComplexMatrixN(), macro_allocStackComplexMatrixN, and populateKrausSuperOperator4().
Referenced by mixTwoQubitKrausMap().
◆ ensureIndsIncrease()
void ensureIndsIncrease | ( | int * | ind1, |
int * | ind2 | ||
) |
Definition at line 70 of file QuEST_common.c.
Referenced by mixTwoQubitDephasing(), and mixTwoQubitDepolarising().
◆ generateMeasurementOutcome()
Definition at line 168 of file QuEST_common.c.
References genrand_real1().
Referenced by densmatr_measureWithStats(), and statevec_measureWithStats().
◆ 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 142 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 120 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 105 of file QuEST_common.c.
References macro_setConjugateMatrix.
Referenced by controlledUnitary(), multiControlledUnitary(), multiStateControlledUnitary(), and unitary().
◆ getConjugateMatrix4()
ComplexMatrix4 getConjugateMatrix4 | ( | ComplexMatrix4 | src | ) |
Definition at line 110 of file QuEST_common.c.
References macro_setConjugateMatrix.
Referenced by controlledTwoQubitUnitary(), multiControlledTwoQubitUnitary(), and twoQubitUnitary().
◆ getConjugateScalar()
Definition at line 91 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, | ||
int | numControlQubits | ||
) |
◆ getQubitBitMask()
long long int getQubitBitMask | ( | int * | qubits, |
int | numQubits | ||
) |
Definition at line 50 of file QuEST_common.c.
Referenced by applyMultiControlledMatrixN(), multiControlledMultiQubitNot(), multiControlledMultiQubitUnitary(), multiControlledMultiRotatePauli(), multiControlledMultiRotateZ(), multiControlledTwoQubitUnitary(), multiControlledUnitary(), multiQubitNot(), multiRotateZ(), multiStateControlledUnitary(), statevec_multiControlledMultiQubitUnitary(), statevec_multiControlledMultiRotatePauli(), statevec_multiControlledPhaseFlip(), statevec_multiControlledPhaseShift(), statevec_multiRotatePauli(), and validateMultiControlsMultiTargets().
◆ getQuESTDefaultSeedKey()
void getQuESTDefaultSeedKey | ( | unsigned long int * | key | ) |
Definition at line 195 of file QuEST_common.c.
Referenced by seedQuESTDefault().
◆ getUnitVector()
Definition at line 84 of file QuEST_common.c.
References getVectorMagnitude(), qreal, Vector::x, Vector::y, and Vector::z.
Referenced by getComplexPairFromRotation().
◆ getVectorMagnitude()
Definition at line 79 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 130 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 185 of file QuEST_common.c.
◆ populateKrausSuperOperator2()
void populateKrausSuperOperator2 | ( | ComplexMatrix4 * | superOp, |
ComplexMatrix2 * | ops, | ||
int | numOps | ||
) |
Definition at line 607 of file QuEST_common.c.
References macro_populateKrausOperator.
Referenced by densmatr_mixKrausMap().
◆ populateKrausSuperOperator4()
void populateKrausSuperOperator4 | ( | ComplexMatrixN * | superOp, |
ComplexMatrix4 * | ops, | ||
int | numOps | ||
) |
Definition at line 611 of file QuEST_common.c.
References macro_populateKrausOperator.
Referenced by densmatr_mixTwoQubitKrausMap().
◆ populateKrausSuperOperatorN()
void populateKrausSuperOperatorN | ( | ComplexMatrixN * | superOp, |
ComplexMatrixN * | ops, | ||
int | numOps | ||
) |
Definition at line 615 of file QuEST_common.c.
References macro_populateKrausOperator, and ComplexMatrixN::numQubits.
Referenced by densmatr_mixMultiQubitKrausMap().
◆ setConjugateMatrixN()
void setConjugateMatrixN | ( | ComplexMatrixN | m | ) |
Definition at line 115 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 156 of file QuEST_common.c.
Referenced by applyPhaseFunc(), applyPhaseFuncOverrides(), controlledMultiQubitUnitary(), multiControlledMultiQubitUnitary(), multiControlledMultiRotatePauli(), multiControlledPhaseFlip(), multiControlledPhaseShift(), multiQubitUnitary(), and multiRotatePauli().
◆ shiftSubregIndices()
void shiftSubregIndices | ( | int * | allInds, |
int * | numIndsPerReg, | ||
int | numRegs, | ||
int | shift | ||
) |
Definition at line 161 of file QuEST_common.c.
Referenced by agnostic_applyQFT(), applyMultiVarPhaseFunc(), applyMultiVarPhaseFuncOverrides(), applyNamedPhaseFunc(), applyNamedPhaseFuncOverrides(), applyParamNamedPhaseFunc(), and applyParamNamedPhaseFuncOverrides().
◆ statevec_applyPauliProd()
void statevec_applyPauliProd | ( | Qureg | workspace, |
int * | targetQubits, | ||
enum pauliOpType * | pauliCodes, | ||
int | numTargets | ||
) |
Definition at line 495 of file QuEST_common.c.
References PAULI_X, PAULI_Y, PAULI_Z, statevec_pauliX(), statevec_pauliY(), and statevec_pauliZ().
Referenced by statevec_applyPauliSum(), and statevec_calcExpecPauliProd().
◆ statevec_applyPauliSum()
void statevec_applyPauliSum | ( | Qureg | inQureg, |
enum pauliOpType * | allCodes, | ||
qreal * | termCoeffs, | ||
int | numSumTerms, | ||
Qureg | outQureg | ||
) |
Definition at line 538 of file QuEST_common.c.
References Qureg::numQubitsRepresented, Complex::real, statevec_applyPauliProd(), statevec_initBlankState(), and statevec_setWeightedQureg().
Referenced by applyPauliHamil(), and applyPauliSum().
◆ statevec_calcExpecPauliProd()
qreal statevec_calcExpecPauliProd | ( | Qureg | qureg, |
int * | targetQubits, | ||
enum pauliOpType * | pauliCodes, | ||
int | numTargets, | ||
Qureg | workspace | ||
) |
Definition at line 509 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 524 of file QuEST_common.c.
References Qureg::numQubitsRepresented, qreal, and statevec_calcExpecPauliProd().
Referenced by calcExpecPauliHamil(), and calcExpecPauliSum().
◆ statevec_calcFidelity()
Definition at line 380 of file QuEST_common.c.
References Complex::imag, qreal, Complex::real, and statevec_calcInnerProduct().
Referenced by calcFidelity().
◆ statevec_controlledMultiQubitUnitary()
void statevec_controlledMultiQubitUnitary | ( | Qureg | qureg, |
int | ctrl, | ||
int * | targets, | ||
int | numTargets, | ||
ComplexMatrixN | u | ||
) |
Definition at line 579 of file QuEST_common.c.
References statevec_multiControlledMultiQubitUnitary().
Referenced by controlledMultiQubitUnitary().
◆ statevec_controlledRotateAroundAxis()
void statevec_controlledRotateAroundAxis | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit, | ||
qreal | angle, | ||
Vector | axis | ||
) |
Definition at line 330 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, |
int | controlQubit, | ||
int | targetQubit, | ||
qreal | angle, | ||
Vector | axis | ||
) |
Definition at line 337 of file QuEST_common.c.
References getComplexPairFromRotation(), Complex::imag, and statevec_controlledCompactUnitary().
Referenced by controlledRotateAroundAxis().
◆ statevec_controlledRotateX()
Definition at line 346 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateX().
◆ statevec_controlledRotateY()
Definition at line 352 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateY().
◆ statevec_controlledRotateZ()
Definition at line 358 of file QuEST_common.c.
References statevec_controlledRotateAroundAxis().
Referenced by controlledRotateZ().
◆ statevec_controlledTwoQubitUnitary()
void statevec_controlledTwoQubitUnitary | ( | Qureg | qureg, |
int | controlQubit, | ||
int | targetQubit1, | ||
int | targetQubit2, | ||
ComplexMatrix4 | u | ||
) |
Definition at line 567 of file QuEST_common.c.
References statevec_multiControlledTwoQubitUnitary().
Referenced by controlledTwoQubitUnitary().
◆ statevec_getProbAmp()
Definition at line 248 of file QuEST_common.c.
References qreal, statevec_getImagAmp(), and statevec_getRealAmp().
Referenced by getProbAmp().
◆ statevec_measureWithStats()
Definition at line 364 of file QuEST_common.c.
References generateMeasurementOutcome(), qreal, statevec_calcProbOfOutcome(), and statevec_collapseToKnownProbOutcome().
Referenced by measure(), and measureWithStats().
◆ statevec_multiControlledMultiRotatePauli()
void statevec_multiControlledMultiRotatePauli | ( | Qureg | qureg, |
long long int | ctrlMask, | ||
int * | targetQubits, | ||
enum pauliOpType * | targetPaulis, | ||
int | numTargets, | ||
qreal | angle, | ||
int | applyConj | ||
) |
Definition at line 453 of file QuEST_common.c.
References getQubitBitMask(), ComplexMatrix2::imag, PAULI_I, PAULI_X, PAULI_Y, qreal, ComplexMatrix2::real, statevec_multiControlledMultiRotateZ(), and statevec_multiControlledUnitary().
Referenced by multiControlledMultiRotatePauli().
◆ statevec_multiQubitUnitary()
void statevec_multiQubitUnitary | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
ComplexMatrixN | u | ||
) |
Definition at line 573 of file QuEST_common.c.
References statevec_multiControlledMultiQubitUnitary().
Referenced by applyMatrixN(), and 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 414 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 applyExponentiatedPauliHamil(), and multiRotatePauli().
◆ statevec_pauliZ()
void statevec_pauliZ | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 261 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by pauliZ(), and statevec_applyPauliProd().
◆ statevec_phaseShift()
Definition at line 254 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by phaseShift().
◆ statevec_rotateAroundAxis()
Definition at line 314 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 321 of file QuEST_common.c.
References getComplexPairFromRotation(), Complex::imag, and statevec_compactUnitary().
Referenced by rotateAroundAxis().
◆ statevec_rotateX()
Definition at line 296 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateX().
◆ statevec_rotateY()
Definition at line 302 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateY().
◆ statevec_rotateZ()
Definition at line 308 of file QuEST_common.c.
References statevec_rotateAroundAxis().
Referenced by rotateZ().
◆ statevec_sGate()
void statevec_sGate | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 268 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by sGate().
◆ statevec_sGateConj()
void statevec_sGateConj | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 282 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 387 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 400 of file QuEST_common.c.
References ComplexMatrix4::imag, ComplexMatrix4::real, and statevec_twoQubitUnitary().
Referenced by sqrtSwapGate().
◆ statevec_tGate()
void statevec_tGate | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 275 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by tGate().
◆ statevec_tGateConj()
void statevec_tGateConj | ( | Qureg | qureg, |
int | targetQubit | ||
) |
Definition at line 289 of file QuEST_common.c.
References Complex::imag, Complex::real, and statevec_phaseShiftByTerm().
Referenced by tGate().
◆ statevec_twoQubitUnitary()
void statevec_twoQubitUnitary | ( | Qureg | qureg, |
int | targetQubit1, | ||
int | targetQubit2, | ||
ComplexMatrix4 | u | ||
) |
Definition at line 561 of file QuEST_common.c.
References statevec_multiControlledTwoQubitUnitary().
Referenced by applyMatrix4(), statevec_sqrtSwapGate(), statevec_sqrtSwapGateConj(), and twoQubitUnitary().