MLIR Passes v1.0
|
Go to the source code of this file.
Functions | |
template<typename T1 , typename T2 > | |
void | mqss::support::transforms::commuteOperation (mlir::Operation *currentOp, int nCtrlsOp1, int nTgtsOp1, int nCtrlsOp2, int nTgtsOp2) |
Commutes two quantum operations if they match a specific pattern. | |
Definition of the commute operation. This function is only valid for two qubit gates. Given a pattern using the template, the function will find the pattern and perform a commute operation.
void mqss::support::transforms::commuteOperation | ( | mlir::Operation * | currentOp, |
int | nCtrlsOp1, | ||
int | nTgtsOp1, | ||
int | nCtrlsOp2, | ||
int | nTgtsOp2 ) |
Commutes two quantum operations if they match a specific pattern.
This function searches for a specific pattern where operation T2 is followed by T1 and attempts to commute them to the order T1 followed by T2, under the constraints of control and target qubit counts.
T1 | The type of the first quantum operation (e.g., an MLIR operation class). |
T2 | The type of the second quantum operation. |
currentOp | The current MLIR operation from which to begin the pattern search. |
nCtrlsOp1 | The number of control qubits associated with operation T1. |
nTgtsOp1 | The number of target qubits associated with operation T1. |
nCtrlsOp2 | The number of control qubits associated with operation T2. |
nTgtsOp2 | The number of target qubits associated with operation T2. |