The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches
FullStateDiagMatr

Functions for applying general all-qubit diagonal matrices, as FullStateDiagMatr. More...

Functions

void applyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix)
 
void applyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)
 
void multiplyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix)
 
void multiplyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)
 

Detailed Description

Functions for applying general all-qubit diagonal matrices, as FullStateDiagMatr.

Function Documentation

◆ applyFullStateDiagMatr()

void applyFullStateDiagMatr ( Qureg qureg,
FullStateDiagMatr matrix )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 412 of file operations.cpp.

412 {
413 validate_quregFields(qureg, __func__);
414 validate_matrixFields(matrix, __func__);
415 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__);
416 validate_matrixIsUnitary(matrix, __func__);
417
418 applyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
419}
void applyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)

Referenced by TEST_CASE().

◆ applyFullStateDiagMatrPower()

void applyFullStateDiagMatrPower ( Qureg qureg,
FullStateDiagMatr matrix,
qcomp exponent )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 421 of file operations.cpp.

421 {
422 validate_quregFields(qureg, __func__);
423 validate_matrixFields(matrix, __func__);
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)
427 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
428
429 bool onlyMultiply = false;
430 (qureg.isDensityMatrix)?
431 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, onlyMultiply):
432 localiser_statevec_allTargDiagMatr(qureg, matrix, exponent);
433}

Referenced by applyFullStateDiagMatr(), and TEST_CASE().

◆ multiplyFullStateDiagMatr()

void multiplyFullStateDiagMatr ( Qureg qureg,
FullStateDiagMatr matrix )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 392 of file operations.cpp.

392 {
393 validate_quregFields(qureg, __func__);
394 validate_matrixFields(matrix, __func__);
395 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
396
397 multiplyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
398}
void multiplyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)

Referenced by TEST_CASE().

◆ multiplyFullStateDiagMatrPower()

void multiplyFullStateDiagMatrPower ( Qureg qureg,
FullStateDiagMatr matrix,
qcomp exponent )
Note
Documentation for this function or struct is under construction!
Attention
This function's input validation has not yet been tested, so erroneous usage may produce unexpected output. Please use with caution!

Definition at line 400 of file operations.cpp.

400 {
401 validate_quregFields(qureg, __func__);
402 validate_matrixFields(matrix, __func__);
403 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
404 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
405
406 bool onlyMultiply = true;
407 (qureg.isDensityMatrix)?
408 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, onlyMultiply):
409 localiser_statevec_allTargDiagMatr(qureg, matrix, exponent);
410}

Referenced by multiplyFullStateDiagMatr(), and TEST_CASE().