munich-quantum-toolkit / munich-quantum-toolkit/core
✨ Add support for register slices in the OpenQASM frontend
Open
@simon1hofmann is already working on this.
Since Sep 17, 2026.
feature
MLIR
- Dominant language
- C++
- Stars
- 133
- Forks
- 73
- Avg merge
- 17h 34m
- Merged PRs (30d)
- 261
Description
🤖 AI text below 🤖
The OpenQASM frontend accepts only a single index in a subscript. Any range is rejected at the ::
h q[0:2]; // error: expected ']', got ':'
parseDesignator parses [, then one expression, then expects ], so this affects every subscript position, including gate operands, measure, and declarations. Constant and dynamic bounds fail alike, and the optional step form q[a:b:c] fails too.
Slices are needed for gates that act on part of a register, for example the multi-controlled ctrl(n-1) @ z q[0:n-2], flag in Grover's algorithm.
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.
Assessment
This issue has not been assessed yet.