Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

✨ Full Support of Classically-Controlled Operations is Missing

未关闭
#168 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp
领域
devtools

调研方向

首先阅读 DDSimDebug.cpp 和 CodePreprocessor.cpp,以跟踪 OpenQASM IfElse 操作的解析和单步执行方式。实现对所列比较条件、经典子集或比特以及包含多条指令的主体的支持,然后验证所提供的 OpenQASM 示例能够通过调试器正常运行。

由索引模型根据 Issue 内容生成。

描述

c++ enhancement help wanted
Problem Statement

IfElse Operations in OpenQASM can be based on more than just equality conditions.
The underlying MQT Core framework already supports all of the different types of IFElse Operations, such as different comparison conditions and checks that only use subsets of classical registers or single classical bits.

Furthermore, we currently only allow IfElse Operations that contain only a single instruction in the "then" block. This makes tracking the current operation easier, but obviously does not match the full OpenQASM standard. We should therefore implement support for multi-instruction bodies accordingly.

The following are some code examples that should work in standard OpenQASM but are not allowed/parsed correctly by the debugger:


qreg q[3];
creg c[3];

...

if (c == 0) {
  x q[0];
}

This only works without the if body:

if (c == 0) x q[0];

qreg q[3];
creg c[3];

...

if (c == 0) {
  x q[0];
}

This is not supported by the Debugger's parser at all.


if (c > 0) x q[0];

The debugger only supports equality conditions for if blocks, but the simulation backend supports other conditions, too, so this should be a straightforward enhancement.


Proposed Solution

In the DDSimDebug.cpp backend and the CodePreprocessor.cpp, support for the corresponding operation types should be added when stepping through the code.

主要语言
C++
星标
21
派生
8
平均合并
5 小时 17 分钟
30 天内合并 PR
21

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

munich-quantum-toolkit/debugger 的其他 Issue

查看 munich-quantum-toolkit/debugger 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。