The Quantum Exact Simulation Toolkit v4.3.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 301 of file multiplication.cpp.

301 {
302 validate_quregFields(qureg, __func__);
303 validate_matrixFields(matrix, __func__);
304 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
305
306 leftapplyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
307}
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 309 of file multiplication.cpp.

309 {
310 validate_quregFields(qureg, __func__);
311 validate_matrixFields(matrix, __func__);
312 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
313 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
314
315 // rho -> matrix^exponent rho
316 bool leftMultiply = true;
317 bool rightMultiply = false;
318 bool rightConj = false;
319
320 (qureg.isDensityMatrix)?
321 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, leftMultiply, rightMultiply, rightConj):
322 localiser_statevec_allTargDiagMatr(qureg, matrix, exponent);
323}

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 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
331 rightapplyFullStateDiagMatrPower(qureg, matrix, 1); // harmlessly re-validates
332}
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 334 of file multiplication.cpp.

334 {
335 validate_quregFields(qureg, __func__);
336 validate_quregIsDensityMatrix(qureg, __func__);
337 validate_matrixFields(matrix, __func__);
338 validate_matrixAndQuregAreCompatible(matrix, qureg, false, __func__); // matrix can be non-unitary
339 validate_matrixExpIsNonDiverging(matrix, exponent, __func__);
340
341 // rho -> rho matrix^exponent
342 bool leftMultiply = false;
343 bool rightMultiply = true;
344 bool rightConj = false;
345 localiser_densmatr_allTargDiagMatr(qureg, matrix, exponent, leftMultiply, rightMultiply, rightConj);
346}

Referenced by rightapplyFullStateDiagMatr(), and TEST_CASE().