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

[BUG] Unsupported Controlled QASM operations

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

维护者通常 1 天内回复

@ryanhill1 已经在做这个了。

开始于 2026年10月20日。

  • #459 来自 @ryanhill1 —— 未关闭

评估

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

调研方向

The error comes from map_qasm_ctrl_op_to_callable, where a TODO notes that controls should be decomposed when not built in. Start by reading that function to see how controlled gates with three or more controls are currently rejected, and check the maintainers' linked issues #32, #121 and #125 for the intended design. Done means the reproducer gate Z_on_two3 with ctrl@ on three qubits validates and produces the expected operations, but the maintainers have not settled on a decomposition approach, so confirm direction in the thread first.

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

描述

bug
Environment
  • PyQASM version: 0.3.2
  • Python version: 3.12.8
  • Operating system: Windows
What happened?

This may be a feature request, but it looks like a partially stubbed implementation based on #32, #121, and #125.

When attempting to define and run a custom gate with multiple controls:

gate Z_on_two3 aa, ab, ac {
    x ac;
    ctrl(2) @ z aa, ab, ac;
    x ac;
}
ctrl@ gate Z_on_two3 qb[0], qb[1], qb[2];

I encounter the following error:

ValidationError: Unsupported controlled QASM operation: z with 3 controls
Source

The error originates from map_qasm_ctrl_op_to_callable, which currently contains the following comment:

# TODO: decompose controls if not built in

Expected Behavior(?)

Support for decomposing multi-controlled operations (e.g., z with 3+ controls), or clarification on whether this is intentionally unsupported.

Suggestions (Optional)

IDK if this is a semantic decomposition or needs full function decomposition to base gate ie through Solavay Kiteav or Cartan. Id assume it can be left to a semantic decomp as openqasm parsing itself accepts gate modifiers directly. LMK future development intent in this category

主要语言
Python
星标
29
派生
33
平均合并
2 天 4 小时
30 天内合并 PR
15

环境准备

从这里开始

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

qBraid/pyqasm 的其他 Issue

查看 qBraid/pyqasm 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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