| 4093 | } |
| 4094 | |
| 4095 | void validate_quregCanBeInitialisedToPureState(Qureg qureg, Qureg pure, const char* caller) { |
| 4096 | |
| 4097 | assertThat(!pure.isDensityMatrix, report::INIT_PURE_STATE_IS_DENSMATR, caller); |
| 4098 | |
| 4099 | // quregs must have the same number of qubits, regardless of dimension |
| 4100 | assertThat( |
| 4101 | qureg.numQubits == pure.numQubits, |
| 4102 | report::INIT_QUREG_HAS_DIFFERENT_NUM_QUBITS_TO_PURE_STATE, |
| 4103 | {{"${NUM_QUREG_QUBITS}", qureg.numQubits}, {"${NUM_PURE_QUBITS}", pure.numQubits}}, |
| 4104 | caller); |
| 4105 | |
| 4106 | (qureg.isDensityMatrix)? |
| 4107 | validateDensMatrCanBeInitialisedToPureState(qureg, pure, caller): |
| 4108 | validateStateVecCanBeInitialisedToPureState(qureg, pure, caller); |
| 4109 | } |
| 4110 | |
| 4111 | void validate_quregsCanBeCloned(Qureg quregA, Qureg quregB, const char* caller) { |
| 4112 |
no test coverage detected