| 364 | } |
| 365 | |
| 366 | void 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 | |
| 380 | void applyMultiControlledDiagMatrPower(Qureg qureg, int* controls, int numControls, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) { |
| 381 | validate_quregFields(qureg, __func__); |
nothing calls this directly
no test coverage detected