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

Function applyControlledDiagMatrPower

quest/src/api/operations.cpp:366–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void applyControlledDiagMatrPower(Qureg qureg, int control, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
367 validate_quregFields(qureg, __func__);
368 validate_controlAndTargets(qureg, control, targets, numTargets, __func__);
369 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also checks fields and is-synced
370 validate_matrixIsUnitary(matrix, __func__);
371 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
372 validate_unitaryExponentIsReal(exponent, __func__);
373
374 // notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
375
376 // harmlessly re-validates
377 applyMultiStateControlledDiagMatrPower(qureg, &control, nullptr, 1, targets, numTargets, matrix, exponent);
378}
379
380void applyMultiControlledDiagMatrPower(Qureg qureg, int* controls, int numControls, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
381 validate_quregFields(qureg, __func__);

Callers

nothing calls this directly

Tested by

no test coverage detected