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

Function applyDiagMatrPower

quest/src/api/operations.cpp:352–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350extern "C" {
351
352void applyDiagMatrPower(Qureg qureg, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
353 validate_quregFields(qureg, __func__);
354 validate_targets(qureg, targets, numTargets, __func__);
355 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also checks fields and is-synced
356 validate_matrixIsUnitary(matrix, __func__);
357 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
358 validate_unitaryExponentIsReal(exponent, __func__);
359
360 // notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
361
362 // harmlessly re-validates
363 applyMultiStateControlledDiagMatrPower(qureg, nullptr, nullptr, 0, targets, numTargets, matrix, exponent);
364}
365
366void applyControlledDiagMatrPower(Qureg qureg, int control, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) {
367 validate_quregFields(qureg, __func__);

Callers

nothing calls this directly

Tested by

no test coverage detected