-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
MLIRAnything related to MLIRAnything related to MLIRenhancementNew feature or requestNew feature or request
Milestone
Description
Description
Add a canonicalization pattern to eliminate redundant DCX operations in the QCO dialect. A DCX operation followed by a DCX operation with swapped targets is equivalent to the identity and can be removed.
Background
The DCX (double-controlled-X) gate's inverse is the DCX gate with swapped targets. This means:
DCX(q0, q1)followed byDCX(q1, q0)cancels out
Proposed Solution
Implement a canonicalization pattern similar to the existing patterns for SWAP and ECR operations that:
- Detects consecutive DCX operations with swapped targets
- Removes both operations by replacing with pass-through qubits
References
- Follow-up from PR #1264: 🗺️ MLIR Dialect Redesign #1264 (comment)
- Similar patterns exist in:
mlir/lib/Dialect/QCO/IR/Operations/StandardGates/SWAPOp.cppmlir/lib/Dialect/QCO/IR/Operations/StandardGates/ECROp.cpp
Implementation Location
The pattern should be added in mlir/lib/Dialect/QCO/IR/Operations/StandardGates/DCXOp.cpp and hasCanonicalizer = 1 should be added to DCXOp in mlir/include/mlir/Dialect/QCO/IR/QCOOps.td.
Labels: enhancement, MLIR
Assignee: burgholzer
Metadata
Metadata
Assignees
Labels
MLIRAnything related to MLIRAnything related to MLIRenhancementNew feature or requestNew feature or request