The Quantum Exact Simulation Toolkit v4.3.0
Loading...
Searching...
No Matches

Functions for pre- or post-multiplying general many-target dense matrices (as CompMatr) upon density matrices. More...

Functions

void leftapplyCompMatr (Qureg qureg, int *targets, int numTargets, CompMatr matrix)
 
void rightapplyCompMatr (Qureg qureg, int *targets, int numTargets, CompMatr matrix)
 

Detailed Description

Functions for pre- or post-multiplying general many-target dense matrices (as CompMatr) upon density matrices.

Function Documentation

◆ leftapplyCompMatr()

void leftapplyCompMatr ( Qureg qureg,
int * targets,
int numTargets,
CompMatr matrix )
Note
Documentation for this function or struct is under construction!
See also

Definition at line 109 of file multiplication.cpp.

109 {
110 validate_quregFields(qureg, __func__);
111 validate_targets(qureg, targets, numTargets, __func__);
112 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also validates fields and is-sync
113 validate_mixedAmpsFitInNode(qureg, numTargets, __func__);
114
115 bool conj = false;
116 bool transp = false;
117 localiser_statevec_anyCtrlAnyTargDenseMatr(qureg, none, none, lists_getList64(targets, numTargets), matrix, conj, transp);
118}

Referenced by leftapplyCompMatr().

◆ rightapplyCompMatr()

void rightapplyCompMatr ( Qureg qureg,
int * targets,
int numTargets,
CompMatr matrix )
Note
Documentation for this function or struct is under construction!
See also

Definition at line 120 of file multiplication.cpp.

120 {
121 validate_quregFields(qureg, __func__);
122 validate_quregIsDensityMatrix(qureg, __func__);
123 validate_targets(qureg, targets, numTargets, __func__);
124 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also validates fields and is-sync
125 validate_mixedAmpsFitInNode(qureg, numTargets, __func__);
126
127 // rho matrix ~ transpose(rho) (x) I ||rho>>
128 bool conj = false;
129 bool transp = true;
130 auto qubits = util_getBraQubits(lists_getList64(targets, numTargets), qureg);
131 localiser_statevec_anyCtrlAnyTargDenseMatr(qureg, none, none, qubits, matrix, conj, transp);
132}

Referenced by rightapplyCompMatr().