catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Add `rulesPath` option to `DecomposeLoweringPass`

Open sengthai opened this issue 2 months ago • 0 comments

Context: Introduced a new option rulesPath in the DecomposeLoweringPass to specify the path for external gate decomposition rules. This work addresses the limitation that MLIR lacks a linker like LLVM, requiring a custom approach to integrate decomposition rules from separate files. In the absence of a rules path, the pass will examine the decomposition rules within the main module instead (preserving the previous behavior of that pass).

Usage: quantum-opt --decompose-lowering="rules-path=<path-to-rules-mlir>" <circuit.mlir>

Example: quantum-opt --decompose-lowering="rules-path=rules.mlir" main.mlir

  • main.mlir contains the quantum circuit with gates to be decomposed
  • rules.mlir contains the list of decomposition rules (functions with target_gate attributes)

Related to: https://github.com/PennyLaneAI/catalyst/pull/2029

sengthai avatar Sep 24 '25 21:09 sengthai