MLIR Passes v1.0
Loading...
Searching...
No Matches
CommutateOperations.hpp File Reference

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.
 

Detailed Description

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.

This header must be included to use the commute operation into a pass.

Function Documentation

◆ commuteOperation()

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.

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.

Template Parameters
T1The type of the first quantum operation (e.g., an MLIR operation class).
T2The type of the second quantum operation.
Parameters
currentOpThe current MLIR operation from which to begin the pattern search.
nCtrlsOp1The number of control qubits associated with operation T1.
nTgtsOp1The number of target qubits associated with operation T1.
nCtrlsOp2The number of control qubits associated with operation T2.
nTgtsOp2The number of target qubits associated with operation T2.