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

Function applyMultiStateControlledRotateZ

quest/src/api/operations.cpp:1116–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1114}
1115
1116void applyMultiStateControlledRotateZ(Qureg qureg, int* controls, int* states, int numControls, int target, qreal angle) {
1117 validate_quregFields(qureg, __func__);
1118 validate_controlsAndTarget(qureg, controls, numControls, target, __func__);
1119 validate_controlStates(states, numControls, __func__); // permits states==nullptr
1120
1121 // note that for the single-target scenario, we do not call the backend of
1122 // applyMultiStateControlledPauliGadget() since it contains sub-optimal logic
1123 // which sees the factor of every amplitude dynamically evaluated (based on
1124 // index parity, etc); the dense-matrix element lookup is faster
1125
1126 // harmlessly re-validates, including hardcoded matrix unitarity
1127 DiagMatr1 matrix = util_getExpPauliZ(angle);
1128 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matrix, __func__);
1129}
1130
1131} // end de-mangler
1132

Callers 3

applyRotateZFunction · 0.85
applyControlledRotateZFunction · 0.85

Tested by

no test coverage detected