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

Function validate_quregCanBeInitialisedToPureState

quest/src/core/validation.cpp:4095–4109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4093}
4094
4095void 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
4111void validate_quregsCanBeCloned(Qureg quregA, Qureg quregB, const char* caller) {
4112

Callers 1

initPureStateFunction · 0.85

Tested by

no test coverage detected