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

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

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

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

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

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

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

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

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

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