Skip to content

Fix synth_qft_line with 32 or more qubits#16004

Merged
Cryoris merged 1 commit intoQiskit:mainfrom
alexanderivrii:fix-qft-line
Apr 13, 2026
Merged

Fix synth_qft_line with 32 or more qubits#16004
Cryoris merged 1 commit intoQiskit:mainfrom
alexanderivrii:fix-qft-line

Conversation

@alexanderivrii
Copy link
Copy Markdown
Member

@alexanderivrii alexanderivrii commented Apr 12, 2026

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

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code:

…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.
@alexanderivrii alexanderivrii requested a review from a team as a code owner April 12, 2026 10:14
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@alexanderivrii alexanderivrii added the Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. label Apr 12, 2026
@alexanderivrii alexanderivrii added the stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge. label Apr 12, 2026
@alexanderivrii alexanderivrii added this to the 2.5.0 milestone Apr 12, 2026
Copy link
Copy Markdown
Member

@ShellyGarion ShellyGarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. good catch!

Copy link
Copy Markdown
Collaborator

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Cryoris Cryoris added this pull request to the merge queue Apr 13, 2026
Merged via the queue into Qiskit:main with commit 32a368f Apr 13, 2026
47 of 49 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in Qiskit 2.5 Apr 13, 2026
mergify Bot pushed a commit that referenced this pull request Apr 13, 2026
…re qubits (#16004)

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)
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>
@ShellyGarion ShellyGarion modified the milestones: 2.5.0, 2.4.0 Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants