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

Function applyMultiControlledDiagMatrPower

quest/src/api/operations.cpp:380–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void applyMultiControlledDiagMatrPower(Qureg qureg, int* controls, int numControls, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
381 validate_quregFields(qureg, __func__);
382 validate_controlsAndTargets(qureg, controls, numControls, targets, numTargets, __func__);
383 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also checks fields and is-synced
384 validate_matrixIsUnitary(matrix, __func__);
385 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
386 validate_unitaryExponentIsReal(exponent, __func__);
387
388 // notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
389
390 // harmlessly re-validates
391 applyMultiStateControlledDiagMatrPower(qureg, controls, nullptr, numControls, targets, numTargets, matrix, exponent);
392}
393
394void applyMultiStateControlledDiagMatrPower(Qureg qureg, int* controls, int* states, int numControls, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
395 validate_quregFields(qureg, __func__);

Callers

nothing calls this directly

Tested by

no test coverage detected