| 140 | */ |
| 141 | |
| 142 | void TEST_ON_CACHED_QUREGS(quregCache quregs, auto& reference, auto& function) { |
| 143 | |
| 144 | for (auto& [label, qureg]: quregs) { |
| 145 | |
| 146 | DYNAMIC_SECTION( label ) { |
| 147 | |
| 148 | // no need to validate whether qureg successfully |
| 149 | // enters the debug state here, because the below |
| 150 | // serial setToDebugState() is guaranteed to succeed |
| 151 | initDebugState(qureg); |
| 152 | setToDebugState(reference); |
| 153 | |
| 154 | function(qureg, reference); |
| 155 | REQUIRE_AGREE( qureg, reference ); |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void TEST_ON_CACHED_QUREG_AND_MATRIX(quregCache quregs, matrixCache matrices, auto apiFunc, auto refState, auto refMatr, auto refFunc) { |
| 161 | |