Fix synth_qft_line with 32 or more qubits#16004
Merged
Cryoris merged 1 commit intoQiskit:mainfrom Apr 13, 2026
Merged
Conversation
…re qubits In the debug more, the previous code panicked (attempt to multiply with overflow) when raising 2_u32 to power 32 or more. And in the release mode, I believe, it silently produced incorrect circuits.
Collaborator
|
One or more of the following people are relevant to this code:
|
Cryoris
approved these changes
Apr 13, 2026
Collaborator
Cryoris
left a comment
There was a problem hiding this comment.
Whoops good catch. It would be nice to have an approximation degree (= max. exponent) here, similar to the standard QFT. But I'm not sure how that influences the efficient decomposition, that'd have to be checked.
3 tasks
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
…re qubits (#16004) (#16007) In the debug more, the previous code panicked (attempt to multiply with overflow) when raising 2_u32 to power 32 or more. And in the release mode, I believe, it silently produced incorrect circuits. (cherry picked from commit 32a368f) Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discovered the bug when experimenting with Jake's script for running Sabre experiments.
In the debug more, the previous code panicked (attempting to multiply with overflow) when raising 2_u32 to power 32 or more. And in the release mode, I believe, the multiplication silently wrapped around, so we just obtained incorrect circuits.
AI/LLM disclosure