inv @ raises on sx, sxdg, p, u, prx, gpi and gpi2
维护者通常 1 天内回复
评估
调研方向
Start by running the snippet in the issue to reproduce the ValidationError: Unsupported / undeclared QASM operation: sx, then grep for that message in the validation/unrolling code to find where a plain inv @ gate is checked. Compare that path with how inv @ ctrl(n) @ maps a gate through its U-form inverse; the fix is to route these single-qubit gates down the same conversion. Done when inv @ unrolls for sx, sxdg, p, u, prx, gpi and gpi2, with tests alongside the existing unroller tests.
由索引模型根据 Issue 内容生成。
描述
inv @ with no ctrl raises on several single-qubit standard gates. It raises on main too, so this isn't a regression from #459.
from pyqasm import loads
m = loads('OPENQASM 3.0;\ninclude "stdgates.inc";\nqubit[1] q;\ninv @ sx q[0];')
m.unroll()
# ValidationError: Unsupported / undeclared QASM operation: sx
Gates that raise: sx, sxdg, p, u, prx, gpi, gpi2. Gates that unroll: U, u2, id, s, t, rz.
inv @ ctrl(n) @ already handles all of these exactly through the U-form inverse, (e^{iγ}U(θ, φ, λ))† = e^{-iγ}U(-θ, -λ, -φ). One fix is to send plain inv @ on a gate with a U-form base down the same path.
Raised by @TheGupta2012 in the review of #459 (L1).
- 主要语言
- Python
- 星标
- 29
- 派生
- 33
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
qBraid/pyqasm 的其他 Issue
-
dumps() prints the original program when unroll() leaves at most one statement可能已有人在做 @ShiveshDragon 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100
维护者通常 1 天内回复
-
enhancement error-handling program-validation
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 43/100
维护者通常 1 天内回复
-
dependencies enhancement
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复