Addition call_graph inconsistent with decomposition for registers with unequal bitsizes
@rupasri118 is already working on this.
Since Sep 29, 2026.
- #1986 by @Pyhroff — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 69/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- quantum-computing, testing-qa
Research direction
Read the Add decomposition and call graph in qualtran/bloqs/arithmetic/addition.py, especially the lines linked in the issue. Reproduce the mismatch with the provided unequal-bit-size example and compare the two T-complexity counts. Done when the call graph and decomposition report consistent counts for that case.
Written by the indexing model from the issue text.
Description
The number of cnots in the call graph for the Add bloq doesn't account for when a_bitsize < b_bitsize. In the decomposition, there is a cnot yielded conditioned on a_bitsize=b_bitsize
https://github.com/quantumlib/Qualtran/blob/9b1bacf8a2233538e6bfdfeb3abe7a780a50c0bb/qualtran/bloqs/arithmetic/addition.py#L192-L193
but the call graph always includes this gate in the count
https://github.com/quantumlib/Qualtran/blob/9b1bacf8a2233538e6bfdfeb3abe7a780a50c0bb/qualtran/bloqs/arithmetic/addition.py#L204
This results in different gate counts depending on what level of decomposition you count. For example
from qualtran.bloqs.arithmetic import Add
a_dtype = QUInt(2)
b_dtype = QUInt(3)
gate = Add(a_dtype=a_dtype,b_dtype=b_dtype)
gate.t_complexity() == gate.decompose_bloq().t_complexity()
returns False.
- Dominant language
- Python
- Stars
- 397
- Forks
- 127
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quantumlib/Qualtran
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
quantumlib/Qualtran#2007 ·
-
`ReflectionUsingPrepare.adjoint()` returns `self` for non-real `global_phase`Possibly taken @doubleMcyber claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
quantumlib/Qualtran#2009 ·
-
Classical simulation fails for a QROAM with block size 1 on one axis: 0-bit `BQUInt` breaks `Partition`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 75/100
quantumlib/Qualtran#2008 ·
-
kickmix: `Circuit.reaction_depth()` materialises every op (≈ 135–170 B/op transient), limiting verifiable circuit sizePossibly taken @manwithacat claimed this 38 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
quantumlib/Qualtran#1993 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
quantumlib/Qualtran#1991 ·
All issues in quantumlib/Qualtran
Similar issues
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nolte/kamerplanter#3193 ·
Maintainers usually reply within 1 day
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day