✨ MLIR - Rotation Gate Merge Pass/Pattern #898
Labels
c++
Anything related to C++ code
enhancement
New feature or request
good first issue
Good for newcomers
MLIR
Anything related to MLIR
Milestone
What's the problem this feature will solve?
We recently introduced the first optimization passes for the MLIR ecosystem we are building #892.
Now this opens up a flood of options for implementing further optimization passes.
One that would be nice to have is an optimization pass that merges rotation gates wherever possible.
Example (qasm-style):
could be merged into
Currently, we only have a pass that cancels consecutive inverse gates (see
core/mlir/include/mlir/Dialect/MQTOpt/Transforms/Passes.td
Lines 31 to 37 in d88d1f0
However, that pass does not handle parametrized gates such as rotation gates.
Describe the solution you'd like
I see two possible ways to implement this:
Both strategies seem reasonable at first glance.
In any case, the pass should at least cover the following rotation gates:
Most likely, an optional parameter for defining a tolerance value would be useful for controlling, when two parametrized gates cancel one another.
Cancellation rules could be derived from
core/src/dd/Operations.cpp
Lines 74 to 142 in d88d1f0
The text was updated successfully, but these errors were encountered: