diff --git a/src/qutip_qip/operations/gateclass.py b/src/qutip_qip/operations/gateclass.py index 75a218d7..a125bad8 100644 --- a/src/qutip_qip/operations/gateclass.py +++ b/src/qutip_qip/operations/gateclass.py @@ -872,10 +872,10 @@ class MS(TwoQubitGate): .. math:: \begin{pmatrix} - \cos(\frac{\theta}{2}) & 0 & 0 & -i\exp^{-i2\phi}\sin(\frac{\theta}{2}) \\ + \cos(\frac{\theta}{2}) & 0 & 0 & -ie^{-i2\phi}\sin(\frac{\theta}{2}) \\ 0 & \cos(\frac{\theta}{2}) & -i\sin(\frac{\theta}{2}) & 0 \\ 0 & -i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) & 0 \\ - -i\exp^{i2\phi}\sin(\frac{\theta}{2}) & 0 & 0 & \cos(\frac{\theta}{2}) + -ie^{i2\phi}\sin(\frac{\theta}{2}) & 0 & 0 & \cos(\frac{\theta}{2}) \end{pmatrix} Examples @@ -895,7 +895,7 @@ def __init__(self, targets, arg_value, **kwargs): self.latex_str = r"{\rm MS}" def get_compact_qobj(self): - return molmer_sorensen(self.arg_value) + return molmer_sorensen(*self.arg_value) class TOFFOLI(Gate): diff --git a/src/qutip_qip/operations/gates.py b/src/qutip_qip/operations/gates.py index 74d35ccd..e080971c 100644 --- a/src/qutip_qip/operations/gates.py +++ b/src/qutip_qip/operations/gates.py @@ -805,7 +805,7 @@ def molmer_sorensen(theta, phi=0.0, N=None, targets=[0, 1]): ) return Qobj( - [ + [ [ np.cos(theta / 2), 0, @@ -1117,7 +1117,6 @@ def qubit_clifford_group(N=None, target=0): partial(reduce, mul), product(_powers(E, 3), _powers(X, 2), _powers(S, 4)), ): - # partial(reduce, mul) returns a function that takes products # of its argument, by analogy to sum. Note that by analogy, # sum can be written as partial(reduce, add). diff --git a/tests/test_gates.py b/tests/test_gates.py index e9c5d7af..3cc8d120 100644 --- a/tests/test_gates.py +++ b/tests/test_gates.py @@ -219,7 +219,7 @@ def test_single_qubit_rotation(self, gate, n_angles): pytest.param(gates.swap, 0, id="swap"), pytest.param(gates.iswap, 0, id="iswap"), pytest.param(gates.sqrtswap, 0, id="sqrt(swap)"), - pytest.param(functools.partial(gates.molmer_sorensen, 0.5*np.pi), 0, + pytest.param(functools.partial(gates.molmer_sorensen, 0.5*np.pi, 0.), 0, id="Molmer-Sorensen") ]) def test_two_qubit(self, gate, n_controls):