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

♻️ Simplify OpenQASM gate and entry-point naming

Open
#2,414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code quality MLIR OpenQASM refactor
Dominant language
C++
Stars
133
Forks
73
Avg merge
17h 34m
Merged PRs (30d)
261

Description

🤖 AI text below 🤖

Problem Statement

OpenQASM import normally names the generated entry function main. A custom gate may also be named main, so the importer renames the entry function to _mqt_entry and probes numbered suffixes against all custom gate names. This works, but spreads a source-name collision into the internal symbol policy and adds special-case code.

This follows up on the final review of #2338.

Proposed Solution

Define a simple internal naming contract that keeps the generated entry point distinct from source-level custom gate symbols. Preserve legal custom gate names, including main, across import and export while maintaining symbol-table uniqueness.

Remove the collision scan if the new invariant provides the same guarantee. Keep regression coverage for a custom gate named main and for collisions with reserved internal names.

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.

Research direction

Start by tracing the OpenQASM importer and exporter code that assigns the generated entry function name, then inspect the symbol-table uniqueness rules. Define the internal naming contract so custom gate names such as main remain legal while reserved internal names stay unique. Preserve regression coverage for both custom main and reserved-name collisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.