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 warning when converting global phase operator to OpenQASM 2.0 #6473

Closed
wants to merge 2 commits into from

Conversation

kenya-sk
Copy link
Contributor

OpenQASM 2.0 does not support global phase (Qiskit/qiskit#7167 (comment)).
Therefore, the current implementation generated an error and terminated the program. Since the global phase does not affect the observation results, I have changed it to be supported as a warning and the program can be executed.

The following is how to handle the situation.

  1. Determine if the operator passed to qasm() is an instance of ops.GlobalPhaseGate. If a Circuit is passed, it is deployed to each operator by existing implementations and a decision is made for each.
  2. If it is an instance of ops.GlobalPhaseGate, generate a warning and return an empty string for compatibility with previous implementations.
  3. Otherwise, the operation is the same as before.

@kenya-sk kenya-sk requested review from vtomole, cduck and a team as code owners February 25, 2024 14:34
@kenya-sk kenya-sk requested a review from dabacon February 25, 2024 14:34
Copy link

google-cla bot commented Feb 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@CirqBot CirqBot added the size: M 50< lines changed <250 label Feb 25, 2024
@kenya-sk
Copy link
Contributor Author

The branch was not appropriate, so it was closed and the pull request was recreated.

@kenya-sk kenya-sk closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants