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

Functions for applying general two-qubit diagonal matrices, as DiagMatr2. More...

Functions

void applyControlledDiagMatr2 (Qureg qureg, int control, int target1, int target2, DiagMatr2 matr)
 
void applyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matr)
 
void applyMultiControlledDiagMatr2 (Qureg qureg, int *controls, int numControls, int target1, int target2, DiagMatr2 matr)
 
void applyMultiStateControlledDiagMatr2 (Qureg qureg, int *controls, int *states, int numControls, int target1, int target2, DiagMatr2 matr)
 
void multiplyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matr)
 

Detailed Description

Functions for applying general two-qubit diagonal matrices, as DiagMatr2.

Function Documentation

◆ applyControlledDiagMatr2()

void applyControlledDiagMatr2 ( Qureg qureg,
int control,
int target1,
int target2,
DiagMatr2 matr )
Note
Documentation for this function or struct is under construction!
See also
applyControlledCompMatr1()

Definition at line 307 of file operations.cpp.

307 {
308
309 int targs[] = {target1, target2};
310 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, targs, 2, matrix, __func__);
311}

◆ applyDiagMatr2()

void applyDiagMatr2 ( Qureg qureg,
int target1,
int target2,
DiagMatr2 matr )
Note
Documentation for this function or struct is under construction!
See also
applyCompMatr1()

Definition at line 301 of file operations.cpp.

301 {
302
303 int targs[] = {target1, target2};
304 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, targs, 2, matrix, __func__);
305}

◆ applyMultiControlledDiagMatr2()

void applyMultiControlledDiagMatr2 ( Qureg qureg,
int * controls,
int numControls,
int target1,
int target2,
DiagMatr2 matr )
Note
Documentation for this function or struct is under construction!
See also
applyMultiControlledCompMatr1()

Definition at line 313 of file operations.cpp.

313 {
314
315 int targs[] = {target1, target2};
316 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, targs, 2, matrix, __func__);
317}

Referenced by applyMultiControlledDiagMatr2().

◆ applyMultiStateControlledDiagMatr2()

void applyMultiStateControlledDiagMatr2 ( Qureg qureg,
int * controls,
int * states,
int numControls,
int target1,
int target2,
DiagMatr2 matr )
Note
Documentation for this function or struct is under construction!
See also
applyMultiStateControlledCompMatr1()

Definition at line 319 of file operations.cpp.

319 {
320
321 int targs[] = {target1, target2};
322 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, targs, 2, matrix, __func__);
323}

Referenced by applyMultiStateControlledDiagMatr2().

◆ multiplyDiagMatr2()

void multiplyDiagMatr2 ( Qureg qureg,
int target1,
int target2,
DiagMatr2 matr )
Note
Documentation for this function or struct is under construction!
See also
multiplyCompMatr1()

Definition at line 292 of file operations.cpp.

292 {
293 validate_quregFields(qureg, __func__);
294 validate_twoTargets(qureg, target1, target2, __func__);
295 validate_matrixFields(matrix, __func__); // matrix can be non-unitary
296
297 bool conj = false;
298 localiser_statevec_anyCtrlTwoTargDiagMatr(qureg, {}, {}, target1, target2, matrix, conj);
299}