munich-quantum-toolkit / munich-quantum-toolkit/core

✨ Add support for register slices in the OpenQASM frontend

Open
#2,110 0 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.