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

Function validate_quregsCanBeMixed

quest/src/core/validation.cpp:4019–4035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4017}
4018
4019void validate_quregsCanBeMixed(Qureg out, Qureg* in, int numIn, const char* caller) {
4020
4021 // mixing in multiple quregs (done here) is much stricter than when
4022 // only one pair is being mixed in, which is handled below
4023
4024 for (int i=0; i<numIn; i++)
4025 validate_quregFields(in[i], caller);
4026
4027 for (int i=0; i<numIn; i++)
4028 assertThat(in[i].isDensityMatrix, report::MIXED_QUREGS_NOT_ALL_DENSITY_MATRICES, caller);
4029
4030 bool valid = true;
4031 for (int i=0; i<numIn && valid; i++)
4032 valid = valid && doQuregsHaveIdenticalMemoryLayouts(out, in[i]);
4033
4034 assertThat(valid, report::MIXED_QUREGS_HAVE_INCONSISTENT_MEM_LAYOUTS, caller);
4035}
4036
4037void validate_quregPairCanBeMixed(Qureg quregOut, Qureg quregIn, const char* caller) {
4038

Callers 1

setQuregToMixtureFunction · 0.85

Calls 3

validate_quregFieldsFunction · 0.85
assertThatFunction · 0.85

Tested by

no test coverage detected