We currently do not have a canonicalization pattern that merges multiple GPhaseOp operations. We should add such a pattern (or a corresponding fold) to qco::GPhaseOp.
In principle, two GPhaseOps can be merged into one by adding their angles. Similarly, two GPhaseOps with opposite angles cancel each other out.
However, implementing such a canonicalization pattern is not straightforward. Because the operation is, well, global, we cannot easily detect all GPhaseOps present in a given module. The naive approach of looping over all operations in the module seems expensive.
For more details, see #1407 (comment).
We currently do not have a canonicalization pattern that merges multiple
GPhaseOpoperations. We should add such a pattern (or a corresponding fold) toqco::GPhaseOp.In principle, two
GPhaseOps can be merged into one by adding their angles. Similarly, twoGPhaseOps with opposite angles cancel each other out.However, implementing such a canonicalization pattern is not straightforward. Because the operation is, well, global, we cannot easily detect all
GPhaseOps present in a given module. The naive approach of looping over all operations in the module seems expensive.For more details, see #1407 (comment).