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

Function calcReducedDensityMatrix

quest/src/api/calculations.cpp:393–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391
392
393Qureg calcReducedDensityMatrix(Qureg qureg, int* retainQubits, int numRetainQubits) {
394 validate_quregFields(qureg, __func__);
395 validate_quregIsDensityMatrix(qureg, __func__);
396 validate_targets(qureg, retainQubits, numRetainQubits, __func__);
397 validate_quregCanBeReduced(qureg, qureg.numQubits - numRetainQubits, __func__);
398
399 auto traceQubits = util_getNonTargetedQubits(retainQubits, numRetainQubits, qureg.numQubits);
400
401 // harmlessly re-validates
402 return calcPartialTrace(qureg, traceQubits.data(), traceQubits.size());
403}
404
405
406} // end de-name mangler

Callers 1

SECTIONFunction · 0.85

Calls 6

validate_quregFieldsFunction · 0.85
validate_targetsFunction · 0.85
calcPartialTraceFunction · 0.85

Tested by

no test coverage detected