MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / applyQubitProjector

Function applyQubitProjector

quest/src/api/operations.cpp:1557–1568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555extern "C" {
1556
1557void applyQubitProjector(Qureg qureg, int target, int outcome) {
1558 validate_quregFields(qureg, __func__);
1559 validate_target(qureg, target, __func__);
1560 validate_measurementOutcomeIsValid(outcome, __func__);
1561
1562 qreal prob = 1;
1563
1564 // density matrix has an optimised func in lieu of calling the statevector func twice
1565 (qureg.isDensityMatrix)?
1566 localiser_densmatr_multiQubitProjector(qureg, {target}, {outcome}, prob):
1567 localiser_statevec_multiQubitProjector(qureg, {target}, {outcome}, prob);
1568}
1569
1570void applyMultiQubitProjector(Qureg qureg, int* qubits, int* outcomes, int numQubits) {
1571 validate_quregFields(qureg, __func__);

Callers 1

SECTIONFunction · 0.85

Tested by

no test coverage detected