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

Functions for applying general many-target dense matrices, as CompMatr. More...

Functions

void applyCompMatr (Qureg qureg, int *targets, int numTargets, CompMatr matr)
 
void applyControlledCompMatr (Qureg qureg, int control, int *targets, int numTargets, CompMatr matr)
 
void applyMultiControlledCompMatr (Qureg qureg, int *controls, int numControls, int *targets, int numTargets, CompMatr matr)
 
void applyMultiStateControlledCompMatr (Qureg qureg, int *controls, int *states, int numControls, int *targets, int numTargets, CompMatr matr)
 
void multiplyCompMatr (Qureg qureg, int *targets, int numTargets, CompMatr matrix)
 

Detailed Description

Functions for applying general many-target dense matrices, as CompMatr.

Function Documentation

◆ applyCompMatr()

void applyCompMatr ( Qureg qureg,
int * targets,
int numTargets,
CompMatr matr )
Note
Documentation for this function or struct is under construction!
Formulae

Let \( M = \) matrix. The qubits within targets are treated to be ordered least to most significant with respect to \( M \). That is, if \( M \) was hypothetically separable single-qubit matrices

\[ M \equiv A \otimes B \otimes C \otimes \dots \]

then this function would effect

\[ \hat{M}_{\text{targets}} \equiv A_{\text{targets}[0]} B_{\text{targets}[1]} C_{\text{targets}[2]} \dots \]

See also

Definition at line 187 of file operations.cpp.

187 {
188
189 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, targets, numTargets, matrix, __func__);
190}

Referenced by applyCompMatr().

◆ applyControlledCompMatr()

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

Definition at line 192 of file operations.cpp.

192 {
193
194 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, targets, numTargets, matrix, __func__);
195}

Referenced by applyControlledCompMatr().

◆ applyMultiControlledCompMatr()

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

Definition at line 197 of file operations.cpp.

197 {
198
199 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, targets, numTargets, matrix, __func__);
200}

Referenced by applyMultiControlledCompMatr().

◆ applyMultiStateControlledCompMatr()

void applyMultiStateControlledCompMatr ( Qureg qureg,
int * controls,
int * states,
int numControls,
int * targets,
int numTargets,
CompMatr matr )
Note
Documentation for this function or struct is under construction!
See also

Definition at line 202 of file operations.cpp.

202 {
203
204 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, targets, numTargets, matrix, __func__);
205}

Referenced by applyMultiStateControlledCompMatr().

◆ multiplyCompMatr()

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

Definition at line 177 of file operations.cpp.

177 {
178 validate_quregFields(qureg, __func__);
179 validate_targets(qureg, targets, numTargets, __func__);
180 validate_matrixDimMatchesTargets(matrix, numTargets, __func__); // also validates fields and is-sync, but not unitarity
181 validate_mixedAmpsFitInNode(qureg, numTargets, __func__);
182
183 bool conj = false;
184 localiser_statevec_anyCtrlAnyTargDenseMatr(qureg, {}, {}, util_getVector(targets, numTargets), matrix, conj);
185}

Referenced by multiplyCompMatr().