The Quantum Exact Simulation Toolkit v4.3.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 matrix)
 
void applyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matrix)
 
void applyMultiControlledDiagMatr2 (Qureg qureg, int *controls, int numControls, int target1, int target2, DiagMatr2 matrix)
 
void applyMultiStateControlledDiagMatr2 (Qureg qureg, int *controls, int *states, int numControls, int target1, int target2, DiagMatr2 matrix)
 

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 matrix )
Note
Documentation for this function or struct is under construction!

Applies a singly-controlled two-qubit diagonal unitary matrix to qubits target1 and target2 of qureg.

‍- See applyDiagMatr2() for information about the base operation.

Author
Tyson Jones

Definition at line 259 of file operations.cpp.

259 {
260
261 int targs[] = {target1, target2};
262 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, targs, 2, matrix, __func__);
263}

◆ applyDiagMatr2()

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

Applies a two-qubit diagonal unitary matrix to qubits target1 and target2 of qureg.

Author
Tyson Jones

Definition at line 253 of file operations.cpp.

253 {
254
255 int targs[] = {target1, target2};
256 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, targs, 2, matrix, __func__);
257}

◆ applyMultiControlledDiagMatr2()

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

Applies a multiply-controlled two-qubit diagonal unitary matrix upon qubits target1 and target2 of qureg.

‍- See applyDiagMatr2() for information about target1, target2 and matrix.

Author
Tyson Jones

Definition at line 265 of file operations.cpp.

265 {
266
267 int targs[] = {target1, target2};
268 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, targs, 2, matrix, __func__);
269}

Referenced by applyMultiControlledDiagMatr2().

◆ applyMultiStateControlledDiagMatr2()

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

Applies an arbitrarily-controlled two-qubit diagonal unitary matrix upon qubits target1 and target2 of qureg, conditioned upon the controls being in the corresponding states.

‍- See applyDiagMatr2() for information about target1, target2 and matrix.

Author
Tyson Jones

Definition at line 271 of file operations.cpp.

271 {
272
273 int targs[] = {target1, target2};
274 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, targs, 2, matrix, __func__);
275}

Referenced by applyMultiStateControlledDiagMatr2().