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 4-pi periodicity of controlled rotations in the CommutationChecker (backport #13670) #13676

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 16, 2025

Summary

The commutation checker currently wrongly assumes that the controlled Pauli rotations CRX/Y/Z are equivalent to the identity for multiples of $2\pi$. However, this is only true for $4\pi$. Note that CP is indeed $2\pi$ periodic.

Details and comments

The tests were modified to compare the output of the commutation checker to a numeric result instead of a hardcoded one, such that this error shouldn't arise in the future again.


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

…er` (#13670)

* start

* fix 4pi periodicity of controlled pauli rots

* review comments by Elena & Sasha

(cherry picked from commit dffc2df)

# Conflicts:
#	crates/accelerate/src/commutation_checker.rs
@mergify mergify bot requested a review from a team as a code owner January 16, 2025 17:05
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jan 16, 2025
Copy link
Contributor Author

mergify bot commented Jan 16, 2025

Cherry-pick of dffc2df has failed:

On branch mergify/bp/stable/1.3/pr-13670
Your branch is up to date with 'origin/stable/1.3'.

You are currently cherry-picking commit dffc2df6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   releasenotes/notes/fix-4pi-periodic-commutations-3b89d1813513f613.yaml
	modified:   test/python/circuit/test_commutation_checker.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   crates/accelerate/src/commutation_checker.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@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 Changelog: Bugfix Include in the "Fixed" section of the changelog mod: transpiler Issues and PRs related to Transpiler labels Jan 16, 2025
@github-actions github-actions bot added this to the 1.3.2 milestone Jan 16, 2025
@Cryoris
Copy link
Contributor

Cryoris commented Jan 16, 2025

This PR requires to backport #13677 first (which we should've backported anyways but forgot). Once #13677 is merged, this might require some merge conflict resolution but all tests should pass then.

@mtreinish
Copy link
Member

@Mergifyio rebase

Copy link
Contributor Author

mergify bot commented Jan 16, 2025

rebase

☑️ Nothing to do

  • -conflict [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • queue-position = -1 [📌 rebase requirement]
  • any of:
    • #commits-behind > 0 [📌 rebase requirement]
    • #commits > 1 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]

@Cryoris
Copy link
Contributor

Cryoris commented Jan 16, 2025

I did a manual merge since the rebase didn't seem to work due to the conflict 🙂

@mtreinish mtreinish enabled auto-merge January 16, 2025 20:43
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12816910695

Details

  • 29 of 29 (100.0%) changed or added relevant lines in 1 file are covered.
  • 15 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.009%) to 88.923%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 92.48%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 12816206533: -0.009%
Covered Lines: 79184
Relevant Lines: 89048

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Jan 16, 2025
Merged via the queue into stable/1.3 with commit dd4ceef Jan 16, 2025
19 checks passed
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 conflicts used by mergify when there are conflicts in a port mod: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants