Skip to content

Fix construction of IQP circuits (backport #14363) #14373

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

Merged
merged 2 commits into from
May 15, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 15, 2025

Summary

As documented in https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.iqp_function, an Instantaneous quantum polynomial time (IQP) circuit consists of Hadamard gates, powers of T-gate, powers of CS-gate, and more Hadamard gates. However, a T-gate is P($\pi$/4), not P($\pi$/8), see https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.PhaseGate. This PR fixes the construction as used both within iqp_function and IQP.

Trivia

The bug was introduced in the original commit #4266 and survived porting to Rust #13241. Incidentally, the original commit pertains to one of the questions from (the internal) Qiskit 2.0 quiz.


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

* Fix construction of IQP circuits

* release notes

* rewording release notes based on suggestion

(cherry picked from commit 6ca3d22)

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

mergify bot commented May 15, 2025

Cherry-pick of 6ca3d22 has failed:

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

You are currently cherry-picking commit 6ca3d22bc.
  (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-iqp-203557797d0d448e.yaml
	modified:   test/python/circuit/library/test_iqp.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   crates/accelerate/src/circuit_library/iqp.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

@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label May 15, 2025
@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 May 15, 2025
@github-actions github-actions bot added this to the 2.0.1 milestone May 15, 2025
@mtreinish mtreinish enabled auto-merge May 15, 2025 16:33
@mtreinish mtreinish added stable backport potential The bug might be minimal and/or import enough to be port to stable and removed conflicts used by mergify when there are conflicts in a port labels May 15, 2025
@mtreinish mtreinish added this pull request to the merge queue May 15, 2025
Merged via the queue into stable/2.0 with commit 92ff3fe May 15, 2025
26 of 27 checks passed
@jakelishman jakelishman deleted the mergify/bp/stable/2.0/pr-14363 branch June 9, 2025 15:42
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 stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants