Multi-level Bloq decomposition for symbolic Bloqs
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with the symbolic-width guards in Bloqs such as LessThanEqual, QROM, and CSwap, and trace how decompose_bloq() and _decompose_from_build_composite_bloq() handle decomposition. The issue gives a minimal reproduction using StatePreparationAliasSampling.from_n_coeff; run it to confirm the failure and inspect the resulting call graph. Done means symbolic subtrees expand into QREF routines with port definitions and connection wiring so GraphViz preserves their topology.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description:
When you instantiate certain Bloq subclasses with Sympy symbols for register widths (e.g.)
StatePreparationAliasSampling.from_n_coeff(L, lam, precision=eps)
the call to decompose_bloq() immediately raises
DecomposeTypeError("bitsize must be a concrete value")
because each of these Bloq classes contains a guard like:
if not isinstance(self.bitsize, int):
raise DecomposeTypeError("bitsize must be a concrete value")
This affects many Bloqs (e.g. LessThanEqual, QROM, CSwap, etc.) and prevents any symbolic-parameter subtree from ever being expanded when you convert to QREF + GraphViz. All you ever see is a monolithic leaf.
There is a private _decompose_from_build_composite_bloq() that builds a CompositeBloq via the call-graph, but it still runs the same per-class guards, so it also refuses on symbolic bitsizes.
Why the “obvious” fixes don’t work
-
Centralizing dual-fallback in the QREF importer
We could catchDecomposeTypeErrorandcall _decompose_from_build_composite_bloq()instead—but that builder itself enforces the sameisinstance(bitsize, int)checks, so symbolic widths are still rejected. -
Using
from_callgraph=True
There is already abloq_to_qref(..., from_callgraph=True)path, but it only reconstructs a flat call-graph of Bloqs. It does not produce real port definitions or connection wiring in the resultingRoutineV1, soto_graphvizon that schema loses all topology.
Minimal repro
import sympy
from qualtran.bloqs.state_preparation import StatePreparationAliasSampling
L, lam, eps = sympy.symbols("L lam eps")
alias = StatePreparationAliasSampling.from_n_coeff(L, lam, precision=eps)
cb = alias.decompose_bloq() # CompositeBloq with 5 leaves
for inst in cb.bloq_instances:
inst.bloq.decompose_bloq() # always raises DecomposeTypeError
Related
MR #1643 adds a dual-fallback for numeric Bloqs, but it still fails for symbolic cases because of the per-class guards.
Tagging @mstechly
- Ngôn ngữ chính
- Python
- Star
- 397
- Fork
- 127
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quantumlib/Qualtran
-
`show_bloq` not workingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
quantumlib/Qualtran#2007 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Addition call_graph inconsistent with decomposition for registers with unequal bitsizesCó thể làm lại được @rupasri118 đã nhận 56 ngày trước và không có pull request nào đang mở. Đang mởkind/bug-report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
quantumlib/Qualtran#1818 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
quantumlib/Qualtran#2008 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
kickmix: `Circuit.reaction_depth()` materialises every op (≈ 135–170 B/op transient), limiting verifiable circuit sizeCó thể đã có người làm @manwithacat đã nhận 27 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
quantumlib/Qualtran#1993 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Windows wheel (or source) for kickmix library needed for Kaggle quantum compilation challengeĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
quantumlib/Qualtran#1991 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của quantumlib/Qualtran
Issue tương tự
-
bug docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
mesa/mesa#4223 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ActivityWatch/docs#223 ·
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier captureCó thể đã có người làm @jianyx1 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
volcengine/OpenViking#8354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ARTPARK-SAHAI-ORG/calibrate-frontend#842 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp/tools P2 tool/skills type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#159541 ·
Maintainer thường phản hồi trong vòng 1 ngày