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

Go to the source code of this file.

Functions

template<typename T1 , typename T2 , typename T3 , typename T4 >
void mqss::support::transforms::patternSwitch (mlir::Operation *currentOp)
 Detects and rewrites a pattern of four quantum operations.
 

Detailed Description

Definition of the switch 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 switch operation.

This header must be included to use the switch operations to manipulate MLIR modules.

Function Documentation

◆ patternSwitch()

template<typename T1 , typename T2 , typename T3 , typename T4 >
void mqss::support::transforms::patternSwitch ( mlir::Operation * currentOp)

Detects and rewrites a pattern of four quantum operations.

Finds the pattern composed of T1, T2 and switches them and assigns the types T3, and T4. Targets and controls should be the same on both. This only works at the moment for single qubit gates

Template Parameters
T1Type of the first operation in the pattern.
T2Type of the second operation in the pattern.
T3Type of the third operation in the pattern.
T4Type of the fourth operation in the pattern.
Parameters
currentOpThe MLIR operation from which the pattern search begins.