Skip to content

Fixing MS gate inverse is not implemented correctly (Issue 7432) #7466

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cirq-ionq/cirq_ionq/ionq_native_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def __pow__(self, power):
return self

if power == -1:
return MSGate(phi0=self.phi0 + 0.5, phi1=self.phi1)
return MSGate(phi0=self.phi0 + 0.5, phi1=self.phi1, theta=self.theta)

return NotImplemented

Expand Down
5 changes: 4 additions & 1 deletion cirq-ionq/cirq_ionq/ionq_native_gates_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ def test_zz_unitary(phase):
[
*[ionq.GPIGate(phi=angle) for angle in PARAMS_FOR_ONE_ANGLE_GATE],
*[ionq.GPI2Gate(phi=angle) for angle in PARAMS_FOR_ONE_ANGLE_GATE],
*[ionq.MSGate(phi0=angles[0], phi1=angles[1]) for angles in PARAMS_FOR_TWO_ANGLE_GATE],
*[
ionq.MSGate(phi0=angles[0], phi1=angles[1], theta=0.8)
for angles in PARAMS_FOR_TWO_ANGLE_GATE
],
*[ionq.ZZGate(theta=angle) for angle in PARAMS_FOR_ONE_ANGLE_GATE],
],
)
Expand Down