Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MLIR] Provide convenience gate builders in tablegen (#1180)
**Context:** There's many scheduled circuit transformation work at the mlir layer, like merge rotations and control flow related transforms, or even hardware gateset decomposition, where creating new gates will be necessary. However, it came to our realization that currently the way to create a new gate in mlir (aka a `quantum.custom` operation) is more complicated than necessary, since all the fields need to be specified, even when the field values are empty. For example, see https://github.com/PennyLaneAI/catalyst/pull/1154/files#diff-bc5ebab69d5c90919840a29058595f8718f5e8a150e141f721250b76a0278f44R49 In light of this, we provide [convenience builders ](https://mlir.llvm.org/docs/DefiningDialects/Operations/#builder-methods) in tablegen. **Description of the Change:** Provide convenience gate builders (aka builders for quantum.custom operations) in tablegen; **Benefits:** No need to specify a bunch of unnecessary boilerplate arguments when creating a new `quantum.custom` operation in a pass. This can also be greatly beneficial for external contributors. **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Mehrdad Malek <39844030+mehrdad2m@users.noreply.github.com>
- Loading branch information