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

Add documentation on OpenQASM 2 phase conventions (backport #10801) #10913

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 28, 2023

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


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* Add documentation on OpenQASM 2 phase conventions

OpenQASM 2 as a language does not provide a way to specify global
phases, either of operations or the entire program.  The prose of the
defining paper talks about the `u1` and `rz` instructions from
`qelib1.inc` as having different global phases, however since the
language cannot represent this, the header file defines `rz` apparently
as a direct alias to `u1`.

Qiskit's position has always been that we interpret `rz` as using the
phase convention of `RZGate`, and `u1` uses the different convention of
`PhaseGate`.  This commit adds documentation to the pages on OpenQASM 2
about this difference, and includes an example of how to override
Qiskit's default if the generating code (e.g. pyZX) wants to use an
alternative phase convention.

* Comment on the number of overrides needed

Co-authored-by: Julien Gacon <gaconju@gmail.com>

---------

Co-authored-by: Julien Gacon <gaconju@gmail.com>
(cherry picked from commit 10461f1)
@mergify mergify bot requested a review from a team as a code owner September 28, 2023 16:04
@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 the following people are requested to review this:

  • @Qiskit/terra-core

@github-actions github-actions bot added documentation Something is not clear or an error documentation mod: qasm2 Relating to OpenQASM 2 import or export Changelog: None Do not include in changelog labels Sep 28, 2023
@github-actions github-actions bot added this to the 0.25.2 milestone Sep 28, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6341418124

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 25 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.03%) to 87.242%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lex.rs 6 90.91%
crates/qasm2/src/parse.rs 18 96.67%
Totals Coverage Status
Change from base Build 6341229224: -0.03%
Covered Lines: 74123
Relevant Lines: 84963

💛 - Coveralls

@1ucian0 1ucian0 modified the milestones: 0.25.2, 0.25.3 Sep 28, 2023
@jakelishman jakelishman added this pull request to the merge queue Sep 28, 2023
@1ucian0 1ucian0 removed this pull request from the merge queue due to a manual request Sep 28, 2023
@1ucian0 1ucian0 added this pull request to the merge queue Sep 28, 2023
@1ucian0 1ucian0 removed this pull request from the merge queue due to a manual request Sep 28, 2023
@1ucian0 1ucian0 added this pull request to the merge queue Sep 28, 2023
@1ucian0 1ucian0 mentioned this pull request Sep 28, 2023
4 tasks
Merged via the queue into stable/0.25 with commit 8d3fd88 Sep 28, 2023
16 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.25/pr-10801 branch September 28, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog documentation Something is not clear or an error documentation mod: qasm2 Relating to OpenQASM 2 import or export
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants