@@ -136,6 +136,14 @@ def BasisConversionPass : Pass<"basis-conversion", "mlir::ModuleOp"> {
136136 - `x(1)` means targeting pauli-x operations with one control (aka, `cx`)
137137 - `x(n)` means targeting pauli-x operation with unbounded number of controls
138138 - `x,x(1)` means targeting both `not` and `cx` operations
139+
140+ The pass automatically selects the set of rewrite patterns, ensuring every
141+ gate is decomposed to the specified basis in a unique way. Options
142+ `enable-patterns` and `disable-patterns` can be used to specify or further
143+ filter the selected rewrite patterns.
144+
145+ If no `basis` is specified or the pass cannot decompose all operations to
146+ the specified basis, the pass application will fail.
139147 }];
140148 let options = [
141149 ListOption<"basis", "basis", "std::string", "Set of basis operations">,
@@ -314,10 +322,9 @@ def DecompositionPass: Pass<"decomposition", "mlir::ModuleOp"> {
314322 the maximum number of iterations is exhausted.
315323
316324 When `basis` is specified, the pass automatically selects the set of rewrite
317- patterns, ensuring an acyclic pattern set targeting the specified basis.
318- Options `enable-patterns` and `disable-patterns` can further filter the
319- selected rewrite patterns.
320-
325+ patterns, ensuring every gate is decomposed to the specified basis in a
326+ unique way. Options `enable-patterns` and `disable-patterns` can be used to
327+ specify or further filter the selected rewrite patterns.
321328
322329 The `basis` option takes a comma-separated list of quantum operations with
323330 the format: `<op-name>([<number-of-controls> | n])?`
@@ -328,6 +335,8 @@ def DecompositionPass: Pass<"decomposition", "mlir::ModuleOp"> {
328335 - `x(n)` — Pauli-X with unbounded controls
329336 - `x,x(1)` — Both `not` and `cx`
330337
338+ If no `basis` is specified, as many patterns as possible are applied.
339+
331340 NOTE: The current implementation is conservative w.r.t global phase, which
332341 means no decomposition will take place under the presence of controlled
333342 `quake.apply` operations in the module.
0 commit comments