The Quantum Exact Simulation Toolkit v4.2.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)
 

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 \dots \otimes C \otimes B \otimes A \]

then this function would effect

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

See also

Definition at line 161 of file operations.cpp.

161 {
162
163 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, targets, numTargets, matrix, __func__);
164}

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

166 {
167
168 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, targets, numTargets, matrix, __func__);
169}

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

171 {
172
173 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, targets, numTargets, matrix, __func__);
174}

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

176 {
177
178 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, targets, numTargets, matrix, __func__);
179}

Referenced by applyMultiStateControlledCompMatr().