Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue/12311 with fractional gate in basis (backport #12511) #12813

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 24, 2024

Summary

This fixes an issue where an exception would be raised if transpiling a unitary gate to a backend with an RZZGate in its basis however transpiling with only basis_gates specified would transpile fine.

fixes #12311

Details and comments

In this case, where RZZ is the only entangling gate in the basis, decomposition of a 2q unitary gate wouldn't get synthesized in the UnitarySynthesis pass but would instead be synthesized in the HighLevelSynthesis pass because this would call the instruction's _define method which calls two_qubit_cnot_decompose. A subsequent BasisTranslator pass ultimately maps the cx to the rzz basis. I'm not sure whether this indirect path to unitary synthesis is intentional.

This pr resolves the specific example posed in the issue.


This is an automatic backport of pull request #12511 done by [Mergify](https://mergify.com).

* linting

* linting...relax check for 3-qubit circuit

* update test docstrings

* black update

* bind RZZ to pi/2 if Rzz(theta) in basis

* Apply suggestions from code review

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
(cherry picked from commit aaaf107)
@mergify mergify bot requested review from alexanderivrii, ShellyGarion and a team as code owners July 24, 2024 22:43
@qiskit-bot
Copy link
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

@github-actions github-actions bot added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jul 24, 2024
@github-actions github-actions bot added this to the 1.1.2 milestone Jul 24, 2024
@mtreinish mtreinish enabled auto-merge July 24, 2024 22:46
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10085063169

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 16 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.003%) to 89.941%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 3 91.86%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 10062297636: -0.003%
Covered Lines: 61847
Relevant Lines: 68764

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Jul 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 25, 2024
@jakelishman jakelishman added this pull request to the merge queue Jul 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 25, 2024
@ElePT ElePT added this pull request to the merge queue Jul 25, 2024
Merged via the queue into stable/1.1 with commit 3baff4c Jul 25, 2024
18 checks passed
@mergify mergify bot deleted the mergify/bp/stable/1.1/pr-12511 branch July 25, 2024 09:15
mtreinish added a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants