Classical simulation fails for a QROAM with block size 1 on one axis: 0-bit `BQUInt` breaks `Partition`
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Start in qualtran/dtype/_uint.py and trace how _UInt.from_bits and _UInt.to_bits handle zero-width registers; the report gives reproducible failures through Partition and BQUInt(0, 1). Check both BQUInt(0, 1) and QUInt(0), then run the reported Partition examples and the QROAMClean decomposition example. Done when zero-bit registers round-trip as 0 without raising or adding an address bit.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A 2D QROAM read with block size 1 on one axis (log_block_sizes=(0, k)) partitions that axis's address into a high part and a 0-bit low part BQUInt(0, 1). Classical simulation of the decomposition then fails on that 0-bit part in both directions. The partition raises, because BQUInt(0, 1).from_bits([]) computes int('', 2). The unpartition silently returns a wrong address, because BQUInt(0, 1).to_bits_array gives one bit instead of zero, so the joined address gains a bit and doubles:
from qualtran import BQUInt, Register
from qualtran.bloqs.bookkeeping import Partition
p = Partition(3, regs=(Register('l', BQUInt(3, 8)), Register('k', BQUInt(0, 1))))
p.call_classically(x=1) # ValueError: invalid literal for int() with base 2: ''
p.adjoint().call_classically(l=1, k=0) # (2,), expected (1,)
Expected: a 0-bit register has no bits and holds 0. The cause is _UInt in qualtran/dtype/_uint.py: from_bits raises on [] (also for QUInt(0)), and to_bits(0) returns [0], since f'{0:00b}' is '0'.
Qualtran's own QROAMClean and SelectSwapQROM fail before this, when decomposing, because SwapWithZero drops the 0-bit selection:
import numpy as np
from qualtran.bloqs.data_loading.qroam_clean import QROAMClean
QROAMClean.build_from_data(np.arange(12).reshape(3, 4), log_block_sizes=(0, 1)).decompose_bloq()
# BloqError: a call to SwapWithZero register dtypes are not consistent Partition<2>.k: BQUInt(0, 1) vs selection: BQUInt(1, 2).
- 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 55 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
-
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 26 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
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
quantumlib/Qualtran#1989 · 1 bình luận ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
OpenFreeEnergy/openfe#2371 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
NCATSTranslator/Babel#1269 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
404 on sample dataĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
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 88/100