Skip to content

✨ Relax condition on modifiers #1727

@denialhaag

Description

@denialhaag

Description

Currently, the modifiers in QC and QCO enforce that their bodies contain a single unitary operation followed by a yield operation. This has led to more complications than benefits. The condition should be dropped altogether, and arbitrarily many operations (unitary as well as, e.g., arith.constants), should be legal.

Acceptance criteria

  • The condition is dropped.
  • All relevant canonicalization patterns are updated accordingly.
  • The translations from qc::QuantumComputation and OpenQASM to QC are updated accordingly. In particular, qc::CompoundOperations inside modifiers can be translated, and the test case mentioned in ✨ Translate qc::IfElseOperation to QC #1717 (comment) is added.
  • Tests are added to cover new edge cases.

Metadata

Metadata

Assignees

Labels

MLIRAnything related to MLIRenhancementImprovement of existing feature

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions