void rotateAroundAxis(MultiQubit multiQubit, const int rotQubit, REAL angle, Vector unitAxis)
Rotate a single qubit by a given angle around a given vector on the Bloch-sphere. ...
REAL collapseToOutcome(MultiQubit multiQubit, const int measureQubit, int outcome)
Updates the state vector to be consistent with measuring the measure qubit in the given outcome (0 or...
void hadamard(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit Hadamard gate.
Information about the environment the program is running in.
void initStateZero(MultiQubit *multiQubit)
Initialise a set of qubits to the classical zero state .
void controlledRotateZ(MultiQubit multiQubit, const int controlQubit, const int targetQubit, REAL angle)
Applies a controlled rotation by a given angle around the Z-axis of the Bloch-sphere.
void QuESTSeedRandom(unsigned long int *seedArray, int numSeeds)
Seed the Mersenne Twister used for random number generation in the QuEST environment with a user defi...
void controlledPhaseGate(MultiQubit multiQubit, const int idQubit1, const int idQubit2)
Apply the (two-qubit) controlled phase gate, also known as the controlled sigmaZ gate.
REAL * secondLevelReduction
void rotateZ(MultiQubit multiQubit, const int rotQubit, REAL angle)
Rotate a single qubit by a given angle around the Z-axis of the Bloch-sphere (also known as a phase s...
REAL * firstLevelReduction
Storage for reduction of probabilities on GPU.
void rotateX(MultiQubit multiQubit, const int rotQubit, REAL angle)
Rotate a single qubit by a given angle around the X-axis of the Bloch-sphere.
int numChunks
Number of chunks the state vector is broken up into – the number of MPI processes used...
struct QuESTEnv QuESTEnv
Information about the environment the program is running in.
void initClassicalState(MultiQubit *multiQubit, long long int stateInd)
Initialise a set of qubits to the classical state with index stateInd.
void closeQuESTEnv(QuESTEnv env)
Initialize the QuEST environment.
void reportState(MultiQubit multiQubit)
Print the current state vector of probability amplitudes for a set of qubits to file.
int measure(MultiQubit multiQubit, int measureQubit)
Measures a single qubit, collapsing it randomly to 0 or 1.
void destroyMultiQubit(MultiQubit multiQubit, QuESTEnv env)
Deallocate a MultiQubit object representing a set of qubits.
void reportMultiQubitParams(MultiQubit multiQubit)
Report metainformation about a set of qubits: number of qubits, number of probability amplitudes...
struct ComplexArray ComplexArray
Represents an array of complex numbers grouped into an array of real components and an array of cores...
void reportStateToScreen(MultiQubit multiQubit, QuESTEnv env, int reportRank)
Print the current state vector of probability amplitudes for a set of qubits to standard out...
void controlledNot(MultiQubit multiQubit, const int controlQubit, const int targetQubit)
Apply the controlled not (single control, single target) gate, also known as the c-X, c-sigma-X, c-Pauli-X and c-bit-flip gate.
void reportQuESTEnv(QuESTEnv env)
Report information about the QuEST environment.
int syncQuESTSuccess(int successCode)
Performs a logical AND on all successCodes held by all processes.
void initStatePlus(MultiQubit *multiQubit)
Initialise a set of qubits to the plus state .
void controlledRotateY(MultiQubit multiQubit, const int controlQubit, const int targetQubit, REAL angle)
Applies a controlled rotation by a given angle around the Y-axis of the Bloch-sphere.
void multiControlledUnitary(MultiQubit multiQubit, int *controlQubits, const int numControlQubits, const int targetQubit, ComplexMatrix2 u)
Apply a general multiple-control single-target unitary, which can include a global phase factor...
void multiControlledPhaseGate(MultiQubit multiQubit, int *controlQubits, int numControlQubits)
Apply the multiple-qubit controlled phase gate, also known as the multiple-qubit controlled sigmaZ ga...
void sigmaZ(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit sigma-Z (also known as the Z, Pauli-Z or phase-flip) gate. ...
void controlledCompactUnitary(MultiQubit multiQubit, const int controlQubit, const int targetQubit, Complex alpha, Complex beta)
Apply a controlled unitary (single control, single target) parameterised by two given complex scalars...
void sGate(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit S gate.
void QuESTSeedRandomDefault(void)
Seed the Mersenne Twister used for random number generation in the QuEST environment with an example ...
void compactUnitary(MultiQubit multiQubit, const int rotQubit, Complex alpha, Complex beta)
Apply a single-qubit unitary parameterised by two given complex scalars.
int numQubits
Number of qubits in the state.
void unitary(MultiQubit multiQubit, const int targetQubit, ComplexMatrix2 u)
Apply a general single-qubit unitary (including a global phase factor).
void createMultiQubit(MultiQubit *multiQubit, int numQubits, QuESTEnv env)
Create a MultiQubit object representing a set of qubits.
void sigmaY(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit sigma-Y (also known as the Y or Pauli-Y) gate.
REAL calcTotalProbability(MultiQubit multiQubit)
Calculate the probability of being in any state by taking the norm of the entire state vector...
struct MultiQubit MultiQubit
Represents a system of qubits.
long long int numAmps
Number of probability amplitudes held in stateVec by this process In the non-MPI version, this is the total number of amplitudes.
void controlledUnitary(MultiQubit multiQubit, const int controlQubit, const int targetQubit, ComplexMatrix2 u)
Apply a general controlled unitary (single control, single target), which can include a global phase ...
void syncQuESTEnv(QuESTEnv env)
Guarantees that all code up to the given point has been executed on all nodes.
void getEnvironmentString(QuESTEnv env, MultiQubit multiQubit, char str[200])
ComplexArray pairStateVec
Temporary storage for a chunk of the state vector received from another process in the MPI version...
struct Complex Complex
Represents one complex number.
Represents an array of complex numbers grouped into an array of real components and an array of cores...
int measureWithStats(MultiQubit multiQubit, int measureQubit, REAL *stateProb)
Measures a single qubit, collapsing it randomly to 0 or 1, and additionally gives the probability of ...
void sigmaX(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit sigma-X (also known as the X, Pauli-X, NOT or bit-flip) gate.
ComplexArray deviceStateVec
Storage for probability amplitudes for the multi qubit state on GPU.
struct ComplexMatrix2 ComplexMatrix2
Represents a 2x2 matrix of complex numbers.
int chunkId
The position of the chunk of the state vector held by this process in the full state vector...
Represents a system of qubits.
void initQuESTEnv(QuESTEnv *env)
Initialize QuEST environment.
void controlledRotateAroundAxis(MultiQubit multiQubit, const int controlQubit, const int targetQubit, REAL angle, Vector axis)
Applies a controlled rotation by a given angle around a given vector on the Bloch-sphere.
void controlledRotateX(MultiQubit multiQubit, const int controlQubit, const int targetQubit, REAL angle)
Applies a controlled rotation by a given angle around the X-axis of the Bloch-sphere.
void tGate(MultiQubit multiQubit, const int targetQubit)
Apply the single-qubit T gate.
Represents a 2x2 matrix of complex numbers.
void rotateY(MultiQubit multiQubit, const int rotQubit, REAL angle)
Rotate a single qubit by a given angle around the Y-axis of the Bloch-sphere.
Represents one complex number.
REAL findProbabilityOfOutcome(MultiQubit multiQubit, const int measureQubit, int outcome)
Gives the probability of a specified qubit being measured in the given outcome (0 or 1)...
ComplexArray stateVec
Probablilty amplitudes for the multi qubit state.