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

Function applyMultiQubitPhaseFlip

quest/src/api/operations.cpp:1464–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462}
1463
1464void applyMultiQubitPhaseFlip(Qureg qureg, int* targets, int numTargets) {
1465 validate_quregFields(qureg, __func__);
1466 validate_targets(qureg, targets, numTargets, __func__);
1467
1468 // treat as a (numTargets-1)-controlled 1-target Pauli Z
1469 DiagMatr1 matr = getDiagMatr1({1, -1});
1470
1471 // harmlessly re-validates
1472 applyMultiStateControlledDiagMatr1(qureg, &targets[1], nullptr, numTargets-1, targets[0], matr);
1473}
1474
1475} // end de-mangler
1476

Callers 2

applyPhaseFlipFunction · 0.85
applyTwoQubitPhaseFlipFunction · 0.85

Calls 4

validate_quregFieldsFunction · 0.85
validate_targetsFunction · 0.85
getDiagMatr1Function · 0.70

Tested by

no test coverage detected