| 737 | } |
| 738 | |
| 739 | void applyMultiStateControlledSqrtSwap(Qureg qureg, int* controls, int* states, int numControls, int target1, int target2) { |
| 740 | validate_quregFields(qureg, __func__); |
| 741 | validate_controlsAndTwoTargets(qureg, controls, numControls, target1, target2, __func__); |
| 742 | validate_controlStates(states, numControls, __func__); // permits states==nullptr |
| 743 | |
| 744 | /// @todo |
| 745 | /// this function exacts sqrtSwap as a dense 2-qubit matrix, |
| 746 | /// where as bespoke communication and simulation strategy is |
| 747 | /// clearly possible which we have not supported because the gate |
| 748 | /// is somewhat esoteric. As such, we must validate mixed-amps fit |
| 749 | |
| 750 | validate_mixedAmpsFitInNode(qureg, 2, __func__); // to throw SqrtSwap error, not generic CompMatr2 error |
| 751 | |
| 752 | CompMatr2 matr = getCompMatr2({ |
| 753 | {1, 0, 0, 0}, |
| 754 | {0, .5+.5_i, .5-.5_i, 0}, |
| 755 | {0, .5-.5_i, .5+.5_i, 0}, |
| 756 | {0, 0, 0, 1}}); |
| 757 | |
| 758 | applyMultiStateControlledCompMatr2(qureg, controls, states, numControls, target1, target2, matr); |
| 759 | } |
| 760 | |
| 761 | } // end de-mangler |
| 762 |
no test coverage detected