The Quantum Exact Simulation Toolkit v4.0.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 186 of file operations.cpp.

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

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 191 of file operations.cpp.

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

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 196 of file operations.cpp.

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

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 201 of file operations.cpp.

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

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 176 of file operations.cpp.

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

Referenced by multiplyCompMatr().