-
Couldn't load subscription status.
- Fork 1.1k
Provide native support for U3 gate #7717
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
base: main
Are you sure you want to change the base?
Conversation
|
To check correctness: from cirq.circuits.qasm_output import QasmUGate
import cirq
from qiskit.circuit.library import U3Gate
from qiskit.quantum_info import Operator
import numpy as np
np.allclose(
cirq.unitary(QasmUGate(0.1/np.pi, 0.2/np.pi, 0.3/np.pi)),
Operator(U3Gate(0.1, 0.2, 0.3)).data
) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7717 +/- ##
=======================================
Coverage 99.38% 99.38%
=======================================
Files 1091 1091
Lines 97901 97907 +6
=======================================
+ Hits 97295 97301 +6
Misses 606 606 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Require the same unitary as in qiskit U3Gate.
Ensure QasmUGate has the same unitary as qiskit U3Gate per https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.U3Gate#u3gate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after adding tests and simplifying global phase evaluation.
Please let me know if it looks ok from your side.
|
Should I add So instead of phase_correction_half_turns = (self.phi + self.lmda) / 2it would be phase_correction_half_turns = (self.phi + self.lmda) / 2 + self.gammaTo minimize changes here we can make it have a default value of 0. |
Adjust QasmUGate to have the same unitary as qiskit U3Gate.
Fixes #7634 and #5959