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

Functions for pre- or post-multiplying general full-state diagonal matrices (FullStateDiagMatr), or powers thereof, upon density matrices. More...

Functions

void leftapplyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix)
 
void leftapplyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)
 
void rightapplyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix)
 
void rightapplyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)
 

Detailed Description

Functions for pre- or post-multiplying general full-state diagonal matrices (FullStateDiagMatr), or powers thereof, upon density matrices.

Function Documentation

◆ leftapplyFullStateDiagMatr()

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

Definition at line 292 of file multiplication.cpp.

292 {
293 validate_quregFields(qureg, __func__);
294 validate_matrixFields(matrix, __func__);
295 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
296
297 leftapplyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
298}
void leftapplyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)

Referenced by TEST_CASE().

◆ leftapplyFullStateDiagMatrPower()

void leftapplyFullStateDiagMatrPower ( 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 unit tested, so erroneous usage may produce unexpected output. Please use with caution!
See also

Definition at line 300 of file multiplication.cpp.

300 {
301 validate_quregFields(qureg, __func__);
302 validate_matrixFields(matrix, __func__);
303 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
304 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
305
306 // rho -> matrix^exponent rho
307 bool leftMultiply = true;
308 bool rightMultiply = false;
309 bool rightConj = false;
310
311 (qureg.isDensityMatrix)?
312 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, leftMultiply, rightMultiply, rightConj):
313 localiser_statevec_allTargDiagMatr(qureg, matrix, exponent);
314}

Referenced by leftapplyFullStateDiagMatr(), and TEST_CASE().

◆ rightapplyFullStateDiagMatr()

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

Definition at line 316 of file multiplication.cpp.

316 {
317 validate_quregFields(qureg, __func__);
318 validate_quregIsDensityMatrix(qureg, __func__);
319 validate_matrixFields(matrix, __func__);
320 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
321
322 rightapplyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
323}
void rightapplyFullStateDiagMatrPower(Qureg qureg, FullStateDiagMatr matrix, qcomp exponent)

Referenced by TEST_CASE().

◆ rightapplyFullStateDiagMatrPower()

void rightapplyFullStateDiagMatrPower ( 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 unit tested, so erroneous usage may produce unexpected output. Please use with caution!
See also

Definition at line 325 of file multiplication.cpp.

325 {
326 validate_quregFields(qureg, __func__);
327 validate_quregIsDensityMatrix(qureg, __func__);
328 validate_matrixFields(matrix, __func__);
329 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
330 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
331
332 // rho -> rho matrix^exponent
333 bool leftMultiply = false;
334 bool rightMultiply = true;
335 bool rightConj = false;
336 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, leftMultiply, rightMultiply, rightConj);
337}

Referenced by rightapplyFullStateDiagMatr(), and TEST_CASE().