| 827 | } |
| 828 | |
| 829 | long long int getIndexOfTargetValues(long long int ref, int* targs, int numTargs, long long int targVal) { |
| 830 | // ref state is the starting index, where the targets can be in any bit state; |
| 831 | // on the bits of the non-target qubits matter |
| 832 | |
| 833 | for (int t=0; t<numTargs; t++) { |
| 834 | int bit = (targVal >> t) & 1; |
| 835 | ref = setBit(ref, targs[t], bit); |
| 836 | } |
| 837 | return ref; |
| 838 | } |
| 839 | |
| 840 | QVector getDFT(QVector in, int* targs, int numTargs) { |
| 841 |