@@ -312,9 +312,9 @@ void applyDiagMatrPower(Qureg qureg, int* targets, int numTargets, DiagMatr matr
312
312
validate_quregFields (qureg, __func__);
313
313
validate_targets (qureg, targets, numTargets, __func__);
314
314
validate_matrixDimMatchesTargets (matrix, numTargets, __func__); // also checks fields and is-synced
315
- validate_matrixIsUnitary (matrix, __func__); // checks abs=1 (so no risk of 0^(-neg exp)) and rechecks fields/synced
316
- validate_matrixExpIsNonDiverging (matrix, exponent, __func__); // harmlessly re-validates fields and is-sync
317
- validate_unitaryExponentIsReal (exponent, __func__); // checks matrix^exponent is approx unitary (abs=1)
315
+ validate_matrixIsUnitary (matrix, __func__);
316
+ validate_matrixExpIsNonDiverging (matrix, exponent, __func__);
317
+ validate_unitaryExponentIsReal (exponent, __func__);
318
318
319
319
// notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
320
320
@@ -326,9 +326,9 @@ void applyControlledDiagMatrPower(Qureg qureg, int control, int* targets, int nu
326
326
validate_quregFields (qureg, __func__);
327
327
validate_controlAndTargets (qureg, control, targets, numTargets, __func__);
328
328
validate_matrixDimMatchesTargets (matrix, numTargets, __func__); // also checks fields and is-synced
329
- validate_matrixIsUnitary (matrix, __func__); // checks abs=1 (so no risk of 0^(-neg exp)) and rechecks fields/synced
330
- validate_matrixExpIsNonDiverging (matrix, exponent, __func__); // harmlessly re-validates fields and is-sync
331
- validate_unitaryExponentIsReal (exponent, __func__); // checks matrix^exponent is approx unitary (abs=1)
329
+ validate_matrixIsUnitary (matrix, __func__);
330
+ validate_matrixExpIsNonDiverging (matrix, exponent, __func__);
331
+ validate_unitaryExponentIsReal (exponent, __func__);
332
332
333
333
// notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
334
334
@@ -340,9 +340,9 @@ void applyMultiControlledDiagMatrPower(Qureg qureg, int* controls, int numContro
340
340
validate_quregFields (qureg, __func__);
341
341
validate_controlsAndTargets (qureg, controls, numControls, targets, numTargets, __func__);
342
342
validate_matrixDimMatchesTargets (matrix, numTargets, __func__); // also checks fields and is-synced
343
- validate_matrixIsUnitary (matrix, __func__); // checks abs=1 (so no risk of 0^(-neg exp)) and rechecks fields/synced
344
- validate_matrixExpIsNonDiverging (matrix, exponent, __func__); // harmlessly re-validates fields and is-sync
345
- validate_unitaryExponentIsReal (exponent, __func__); // checks matrix^exponent is approx unitary (abs=1)
343
+ validate_matrixIsUnitary (matrix, __func__);
344
+ validate_matrixExpIsNonDiverging (matrix, exponent, __func__);
345
+ validate_unitaryExponentIsReal (exponent, __func__);
346
346
347
347
// notice exponent is a 'qcomp' not a 'qreal' despite validation; see applyMultiStateControlledDiagMatrPower()
348
348
@@ -354,10 +354,10 @@ void applyMultiStateControlledDiagMatrPower(Qureg qureg, int* controls, int* sta
354
354
validate_quregFields (qureg, __func__);
355
355
validate_controlsAndTargets (qureg, controls, numControls, targets, numTargets, __func__);
356
356
validate_controlStates (states, numControls, __func__); // can be nullptr, ignoring numControls
357
- validate_matrixDimMatchesTargets (matrix, numTargets, __func__); // also checks fields and is-synced
358
- validate_matrixIsUnitary (matrix, __func__); // checks abs=1 (so no risk of 0^(-neg exp)) and rechecks fields/synced
359
- validate_matrixExpIsNonDiverging (matrix, exponent, __func__); // harmlessly re-validates fields and is-sync
360
- validate_unitaryExponentIsReal (exponent, __func__); // checks matrix^exponent is approx unitary (abs=1)
357
+ validate_matrixDimMatchesTargets (matrix, numTargets, __func__);
358
+ validate_matrixIsUnitary (matrix, __func__);
359
+ validate_matrixExpIsNonDiverging (matrix, exponent, __func__);
360
+ validate_unitaryExponentIsReal (exponent, __func__);
361
361
362
362
// unlike calcExpecDiagMatrPower which accepts a 'qreal' exponent,
363
363
// this function accepts a 'qcomp'. This is because it always
@@ -422,8 +422,8 @@ void applyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp ex
422
422
validate_quregFields (qureg, __func__);
423
423
validate_matrixFields (matrix, __func__);
424
424
validate_matrixAndQuregAreCompatible (matrix, qureg, false , __func__);
425
- validate_matrixIsUnitary (matrix, __func__); // checks abs=1 (so no risk of 0^(-neg exp))
426
- validate_unitaryExponentIsReal (exponent, __func__); // checks matrix^exponent is approx unitary (abs=1)
425
+ validate_matrixIsUnitary (matrix, __func__);
426
+ validate_unitaryExponentIsReal (exponent, __func__);
427
427
validate_matrixExpIsNonDiverging (matrix, exponent, __func__);
428
428
429
429
bool onlyMultiply = false ;
0 commit comments