| 350 | extern "C" { |
| 351 | |
| 352 | void 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 | |
| 366 | void applyControlledDiagMatrPower(Qureg qureg, int control, int* targets, int numTargets, DiagMatr matrix, qcomp exponent) { |
| 367 | validate_quregFields(qureg, __func__); |
nothing calls this directly
no test coverage detected