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

Function localiser_statevec_anyCtrlAnyTargDiagMatr

quest/src/core/localiser.cpp:1135–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133
1134
1135void localiser_statevec_anyCtrlAnyTargDiagMatr(Qureg qureg, vector<int> ctrls, vector<int> ctrlStates, vector<int> targs, DiagMatr matr, qcomp exponent, bool conj) {
1136 assertValidCtrlStates(ctrls, ctrlStates);
1137 setDefaultCtrlStates(ctrls, ctrlStates);
1138
1139 // node has nothing to do if all local amps violate control condition
1140 if (!doAnyLocalStatesHaveQubitValues(qureg, ctrls, ctrlStates))
1141 return;
1142
1143 // retain only suffix control qubits, as relevant to local amp modification
1144 removePrefixQubitsAndStates(qureg, ctrls, ctrlStates);
1145 accel_statevec_anyCtrlAnyTargDiagMatr_sub(qureg, ctrls, ctrlStates, targs, matr, exponent, conj);
1146}
1147
1148
1149

Tested by

no test coverage detected