Skip to content

#16974 fix TwoQubitBasisDecomposer with approximation_degree=1.0 - #16975

Open
Gavin King (gavinking) wants to merge 1 commit into
Qiskit:mainfrom
gavinking:#16974
Open

#16974 fix TwoQubitBasisDecomposer with approximation_degree=1.0#16975
Gavin King (gavinking) wants to merge 1 commit into
Qiskit:mainfrom
gavinking:#16974

Conversation

@gavinking

Copy link
Copy Markdown

TwoQubitBasisDecomposer was silently approximating small controlled rotations at optimization levels 2 and 3 with a hardcoded fidelity threshold of 1 - 1e-9, despite approximation_degree=1.0.

The fix disables approximate Weyl specialization of the target when TwoQubitBasisDecomposer is called with approximate=False. Approximate mode retains its previous behavior.

Fixes #16974.

AI/LLM disclosure

  • No part of this submission is LLM generated.
  • Some written text was generated by:
  • Some submitted code was generated by: Astra

TwoQubitBasisDecomposer was silently approximating small controlled
rotations at optimization levels 2 and 3 with a hardcoded fidelity
threshold of 1 - 1e-9, despite approximation_degree=1.0.

The fix disables approximate Weyl specialization of the target when
`TwoQubitBasisDecomposer` is called with `approximate=False`.
Approximate mode retains its previous behavior.
@gavinking
Gavin King (gavinking) requested a review from a team as a code owner September 10, 2026 18:42
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Sep 10, 2026
@qiskit-bot

Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

  • @Qiskit/terra-core
  • @levbishop

@CLAassistant

CLAassistant commented Sep 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is proposing to change the default behaviour of one of the most central passes of Qiskit synthesis - it may have potentially significant knock-on effects on how the complete compiler pipeline works. The approximation_degree docs here do say "no approximation", but similar documentation elsewhere says "up to numerical precision" (which is ambiguous - decompositions are complex and the absolute precision we can guarantee isn't reliable), and this default fidelity has been set like this for a long time.

We need to discuss whether the fault is in documentation, expectations, and whether this requires knock-on changes to other parts of the stack. Let me remand that to the ongoing discussion in #16864.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

TwoQubitBasisDecomposer approximates even when approximation_degree=1.0

4 participants