Classical simulation fails for a QROAM with block size 1 on one axis: 0-bit `BQUInt` breaks `Partition`
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 75/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- Python
- スター
- 397
- フォーク
- 127
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quantumlib/Qualtran のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
quantumlib/Qualtran#2007 ·
メンテナーはふだん 3 日以内に返信
-
Addition call_graph inconsistent with decomposition for registers with unequal bitsizes再び着手できるかも @rupasri118 が 55 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンkind/bug-report
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
quantumlib/Qualtran#1818 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
kickmix: `Circuit.reaction_depth()` materialises every op (≈ 135–170 B/op transient), limiting verifiable circuit size対応中かも @manwithacat が 26 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
quantumlib/Qualtran#1993 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
quantumlib/Qualtran#1991 ·
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
quantumlib/Qualtran#1989 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
quantumlib/Qualtran の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
OpenFreeEnergy/openfe#2371 ·
メンテナーはふだん 2 日以内に返信
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
NCATSTranslator/Babel#1269 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
404 on sample dataオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100