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) #12745

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

mergify bot commented Jul 9, 2024

Cherry-pick of d86f995 has failed:

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

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 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
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9856351473

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 3 files lost coverage.
  • Overall coverage remained the same at 89.942%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.2%
crates/qasm2/src/lex.rs 4 92.11%
Totals Coverage Status
Change from base Build 9839420877: 0.0%
Covered Lines: 61845
Relevant Lines: 68761

💛 - Coveralls

@1ucian0 1ucian0 enabled auto-merge July 9, 2024 12:12
@1ucian0 1ucian0 added this pull request to the merge queue Jul 9, 2024
Merged via the queue into stable/1.1 with commit 6b57b78 Jul 9, 2024
17 checks passed
@mergify mergify bot deleted the mergify/bp/stable/1.1/pr-12742 branch July 9, 2024 16:05
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