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

Go to the source code of this file.

Functions

template<typename T1 , typename T2 >
void mqss::support::transforms::patternCancellation (mlir::Operation *currentOp, int nCtrlsOp1, int nTgtsOp1, int nCtrlsOp2, int nTgtsOp2)
 Function that removes (cancel) a pattern of two quantum operations under specific constraints.
 

Detailed Description

Definition of the cancellation operation at MLIR level. Given a pattern specified by the template, the function will find the pattern and remove it from a given mlir module.

This header must be included to use the pattern cancellation into a pass.

Function Documentation

◆ patternCancellation()

template<typename T1 , typename T2 >
void mqss::support::transforms::patternCancellation ( mlir::Operation * currentOp,
int nCtrlsOp1,
int nTgtsOp1,
int nCtrlsOp2,
int nTgtsOp2 )

Function that removes (cancel) a pattern of two quantum operations under specific constraints.

This function examines the current operation and tries to cancel two operations based on the number of control and target qubits they involve.

Template Parameters
T1is the type of the first operation (e.g., a specific MLIR Op class).
T2is the type of the second operation.
Parameters
[in]currentOppointer to the current MLIR operation being analyzed.
[in]nCtrlsOp1number of control qubits in the first operation.
[in]nTgtsOp1number of target qubits in the first operation.
[in]nCtrlsOp2number of control qubits in the second operation.
[in]nTgtsOp2number of target qubits in the second operation.