The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches

Functions for effecting projectors which break the state normalisation. More...

Functions

void applyMultiQubitProjector (Qureg qureg, int *qubits, int *outcomes, int numQubits)
 
void applyQubitProjector (Qureg qureg, int target, int outcome)
 

Detailed Description

Functions for effecting projectors which break the state normalisation.

Function Documentation

◆ applyMultiQubitProjector()

void applyMultiQubitProjector ( Qureg qureg,
int * qubits,
int * outcomes,
int numQubits )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 1437 of file operations.cpp.

1437 {
1438 validate_quregFields(qureg, __func__);
1439 validate_targets(qureg, qubits, numQubits, __func__);
1440 validate_measurementOutcomesAreValid(outcomes, numQubits, __func__);
1441
1442 qreal prob = 1;
1443 auto qubitVec = util_getVector(qubits, numQubits);
1444 auto outcomeVec = util_getVector(outcomes, numQubits);
1445
1446 (qureg.isDensityMatrix)?
1447 localiser_densmatr_multiQubitProjector(qureg, qubitVec, outcomeVec, prob):
1448 localiser_statevec_multiQubitProjector(qureg, qubitVec, outcomeVec, prob);
1449}

Referenced by TEST_CASE().

◆ applyQubitProjector()

void applyQubitProjector ( Qureg qureg,
int target,
int outcome )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 1366 of file operations.cpp.

1366 {
1367 validate_quregFields(qureg, __func__);
1368 validate_target(qureg, target, __func__);
1369 validate_measurementOutcomeIsValid(outcome, __func__);
1370
1371 // we permit the outcome to be negligibly likely, leaving state = null
1372 qreal prob = 1;
1373 (qureg.isDensityMatrix)?
1374 localiser_densmatr_multiQubitProjector(qureg, {target}, {outcome}, prob):
1375 localiser_statevec_multiQubitProjector(qureg, {target}, {outcome}, prob);
1376}

Referenced by TEST_CASE().