munich-quantum-toolkit / munich-quantum-toolkit/core
✨ Recognize unitary OpenQASM gates with structured control flow
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 133
- Forks
- 73
- Avg merge
- 17h 34m
- Merged PRs (30d)
- 261
Description
🤖 AI text below 🤖
Problem Statement
OpenQASM import currently marks every custom gate that requires structured control flow as non-unitary. This includes gates with statically bounded for loops whose bodies contain only unitary operations. Callers of such gates also remain non-unitary, which prevents later unitary-only handling even when the source gate is safe.
This follows up on the final review of #2338.
Proposed Solution
Add conservative unitary recognition for structured custom-gate bodies. Support at least statically bounded for loops whose bodies contain only unitary operations or calls to unitary gates. Propagate the result through callers.
Leave functions unmarked when they contain non-unitary operations, recursion, unresolved calls, or unsupported control flow. Add import and round-trip tests for accepted loops and rejected non-unitary bodies.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenQASM importer’s handling of custom-gate unitary analysis and review the final changes discussed in #2338. Trace how structured control flow and calls are classified, then run or add import and round-trip tests for bounded unitary loops and rejected non-unitary, recursive, unresolved, or unsupported cases. Done means safe gates and their callers are recognized while unsafe functions remain unmarked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100