Skip to content

Commit

Permalink
update latex and corrected test inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrazander committed Mar 22, 2023
1 parent 0b53044 commit 124a728
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/qutip_qip/operations/gateclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions src/qutip_qip/operations/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def molmer_sorensen(theta, phi=0.0, N=None, targets=[0, 1]):
)

return Qobj(
[
[
[
np.cos(theta / 2),
0,
Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 124a728

Please sign in to comment.