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

Functions for applying general two-qubit dense matrices, as CompMatr2. More...

Functions

void applyCompMatr2 (Qureg qureg, int target1, int target2, CompMatr2 matrix)
 
void applyControlledCompMatr2 (Qureg qureg, int control, int target1, int target2, CompMatr2 matrix)
 
void applyMultiControlledCompMatr2 (Qureg qureg, int *controls, int numControls, int target1, int target2, CompMatr2 matrix)
 
void applyMultiStateControlledCompMatr2 (Qureg qureg, int *controls, int *states, int numControls, int target1, int target2, CompMatr2 matrix)
 

Detailed Description

Functions for applying general two-qubit dense matrices, as CompMatr2.

Function Documentation

◆ applyCompMatr2()

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

Applies a general two-qubit dense unitary matrix to qubits target1 and target2 (treated as increasing significance) of qureg.

Diagram
See also
Author
Tyson Jones

Definition at line 116 of file operations.cpp.

116 {
117
118 int targs[] = {target1, target2};
119 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, targs, 2, matrix, __func__);
120}

◆ applyControlledCompMatr2()

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

Applies a singly-controlled two-qubit dense unitary matrix to qubits target1 and target2 (treated as increasing significance) of qureg.

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


Diagram
See also
Author
Tyson Jones

Definition at line 122 of file operations.cpp.

122 {
123
124 int targs[] = {target1, target2};
125 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, targs, 2, matrix, __func__);
126}

◆ applyMultiControlledCompMatr2()

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

Applies a multiply-controlled two-qubit dense unitary matrix to qubits target1 and target2 (treated as increasing significance) of qureg.

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


Diagram
See also

Definition at line 128 of file operations.cpp.

128 {
129
130 int targs[] = {target1, target2};
131 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, targs, 2, matrix, __func__);
132}

Referenced by applyMultiControlledCompMatr2().

◆ applyMultiStateControlledCompMatr2()

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

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

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


Diagram
See also
Author
Tyson Jones

Definition at line 134 of file operations.cpp.

134 {
135
136 int targs[] = {target1, target2};
137 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, targs, 2, matrix, __func__);
138}

Referenced by applyMultiStateControlledCompMatr2(), and applyMultiStateControlledSqrtSwap().