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

Function applyMultiQubitPhaseShift

quest/src/api/operations.cpp:1421–1430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419}
1420
1421void applyMultiQubitPhaseShift(Qureg qureg, int* targets, int numTargets, qreal angle) {
1422 validate_quregFields(qureg, __func__);
1423 validate_targets(qureg, targets, numTargets, __func__);
1424
1425 // treat as a (numTargets-1)-controlled 1-target diagonal matrix
1426 DiagMatr1 matr = getDiagMatr1({1, std::exp(1_i * angle)});
1427
1428 // harmlessly re-validates
1429 applyMultiStateControlledDiagMatr1(qureg, &targets[1], nullptr, numTargets-1, targets[0], matr);
1430}
1431
1432} // end de-mangler
1433

Callers 2

applyPhaseShiftFunction · 0.85
applyTwoQubitPhaseShiftFunction · 0.85

Calls 4

validate_quregFieldsFunction · 0.85
validate_targetsFunction · 0.85
getDiagMatr1Function · 0.70

Tested by

no test coverage detected