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 C3SXGate to_matrix method (backport #12742) #12744

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 9, 2024

Summary

This PR adds the with_controlled_gate_array decorator missing in C3SXGate that enables the to_matrix method. This bug was found while porting C3SXGate to Rust (#12659).

Details and comments

I have also noticed that the path of C3SXGate is incorrect. It's currently in qiskit/circuit/library/standard_gates/x.py while it should be in qiskit/circuit/library/standard_gates/sx.py. I did not address this issue in the current PR because I believe the move to the correct location is a breaking change and should probably be left for 2.0 (although most users won't import gates directly from the file).


This is an automatic backport of pull request #12742 done by Mergify.

* Fix c3sx matrix

* Apply Jake's suggestion

(cherry picked from commit d86f995)

# Conflicts:
#	test/python/circuit/test_rust_equivalence.py
Copy link
Contributor Author

mergify bot commented Jul 9, 2024

Cherry-pick of d86f995 has failed:

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

You are currently cherry-picking commit d86f99585.
  (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:
	modified:   qiskit/circuit/library/standard_gates/x.py
	new file:   releasenotes/notes/fix-c3sx-gate-matrix-050cf9f9ac3b2b82.yaml
	modified:   test/python/circuit/test_controlled_gate.py

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   test/python/circuit/test_rust_equivalence.py

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

@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jul 9, 2024
@mergify mergify bot requested a review from a team as a code owner July 9, 2024 11:06
@mergify mergify bot mentioned this pull request Jul 9, 2024
@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:

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@github-actions github-actions bot added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Jul 9, 2024
@ElePT ElePT removed the conflicts used by mergify when there are conflicts in a port label Jul 9, 2024
@ElePT ElePT enabled auto-merge July 9, 2024 11:59
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9856319240

Details

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

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 92.37%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 9759407629: -0.01%
Covered Lines: 74519
Relevant Lines: 85459

💛 - Coveralls

@ElePT ElePT added this pull request to the merge queue Jul 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2024
@mtreinish mtreinish added this pull request to the merge queue Jul 9, 2024
Merged via the queue into stable/0.46 with commit 864a238 Jul 9, 2024
11 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.46/pr-12742 branch July 9, 2024 18:11
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.

4 participants