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

Function applyMultiStateControlledRotateY

quest/src/api/operations.cpp:1101–1114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1099}
1100
1101void applyMultiStateControlledRotateY(Qureg qureg, int* controls, int* states, int numControls, int target, qreal angle) {
1102 validate_quregFields(qureg, __func__);
1103 validate_controlsAndTarget(qureg, controls, numControls, target, __func__);
1104 validate_controlStates(states, numControls, __func__); // permits states==nullptr
1105
1106 // note that for the single-target scenario, we do not call the backend of
1107 // applyMultiStateControlledPauliGadget() since it contains sub-optimal logic
1108 // which sees the factor of every amplitude dynamically evaluated (based on
1109 // index parity, etc); the dense-matrix element lookup is faster
1110
1111 // harmlessly re-validates, including hardcoded matrix unitarity
1112 CompMatr1 matrix = util_getExpPauliY(angle);
1113 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matrix, __func__);
1114}
1115
1116void applyMultiStateControlledRotateZ(Qureg qureg, int* controls, int* states, int numControls, int target, qreal angle) {
1117 validate_quregFields(qureg, __func__);

Callers 3

applyRotateYFunction · 0.85
applyControlledRotateYFunction · 0.85

Tested by

no test coverage detected