| 378 | } |
| 379 | |
| 380 | void 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 | |
| 394 | void applyMultiStateControlledDiagMatrPower(Qureg qureg, int* controls, int* states, int numControls, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) { |
| 395 | validate_quregFields(qureg, __func__); |
nothing calls this directly
no test coverage detected