Skip to content

Commit 23c7a0f

Browse files
committed
fix matrix
1 parent 939fb6e commit 23c7a0f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cirq-ionq/cirq_ionq/ionq_native_gates.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ class MSGate(cirq.Gate):
183183
184184
$$
185185
\begin{bmatrix}
186-
cos{\theta} & 0 & 0 & -i*e^{-i*2*\pi(\phi_0+\phi_1)}*sin{\theta} \\
187-
0 & cos{\theta} & -i*e^{-i*2*\pi(\phi_0-\phi_1)}*sin{\theta} & 0 \\
188-
0 & -i*e^{i*2*\pi(\phi_0-\phi_1)}*sin(\theta) & cos{\theta} & 0 \\
189-
-i*e^{i*2*\pi(\phi_0+\phi_1)}*sin{\theta} & 0 & 0 & cos{\theta}
186+
cos{\theta/2} & 0 & 0 & -i*e^{-i*2*\pi(\phi_0+\phi_1)}*sin{\theta/2} \\
187+
0 & cos{\theta/2} & -i*e^{-i*2*\pi(\phi_0-\phi_1)}*sin{\theta/2} & 0 \\
188+
0 & -i*e^{i*2*\pi(\phi_0-\phi_1)}*sin(\theta/2) & cos{\theta/2} & 0 \\
189+
-i*e^{i*2*\pi(\phi_0+\phi_1)}*sin{\theta/2} & 0 & 0 & cos{\theta/2}
190190
\end{bmatrix}
191191
$$
192192
@@ -202,8 +202,8 @@ def _unitary_(self) -> np.ndarray:
202202
theta = self.theta
203203
phi0 = self.phi0
204204
phi1 = self.phi1
205-
diag = np.cos(2 * math.pi * theta)
206-
sin = np.sin(2 * math.pi * theta)
205+
diag = np.cos(math.pi * theta)
206+
sin = np.sin(math.pi * theta)
207207

208208
return np.array(
209209
[

0 commit comments

Comments
 (0)