Skip to content

Commit 66f759c

Browse files
committed
Fix format, mypy and pylint errors.
1 parent 4285f8f commit 66f759c

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

qualtran/rotation_synthesis/matrix/_clifford_t_repr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _xz_sequence(
8181

8282

8383
def _matsumoto_amano_sequence(matrix: _su2_ct.SU2CliffordT) -> tuple[str, ...]:
84-
"""Represents the Clifford+T operator in the Matsumoto-Amano normal form.
84+
r"""Represents the Clifford+T operator in the Matsumoto-Amano normal form.
8585
8686
Returns:
8787
a list of gates matching the regular expression $(T|\eps)(HT|SHT)^*C$,
@@ -103,6 +103,7 @@ def _matsumoto_amano_sequence(matrix: _su2_ct.SU2CliffordT) -> tuple[str, ...]:
103103
if np.all(parity[:, i] == 0):
104104
parity[:, [i, 2]] = parity[:, [2, i]]
105105
break
106+
gates : tuple[str, ...] = ()
106107
if np.array_equal(parity, np.array([[1, 1, 0], [1, 1, 0], [0, 0, 0]])):
107108
# Leftmost syllabe is T
108109
new = _su2_ct.TSqrt2.adjoint() @ matrix

qualtran/rotation_synthesis/matrix/clifford_t_repr_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_to_cirq(g: _su2_ct.SU2CliffordT, fmt: str):
7373
@pytest.mark.parametrize(
7474
["g", "fmt", "expected"],
7575
[
76-
[_su2_ct.HSqrt2, "t", ('"Z^½"', '"X"', '"Z^½"', '"X"', '"H"',)],
76+
[_su2_ct.HSqrt2, "t", ('"Z^½"', '"X"', '"Z^½"', '"X"', '"H"')],
7777
[_su2_ct.SSqrt2, "t", ('{"id":"Rzft","arg":"pi/2"}',)],
7878
[_su2_ct.TSqrt2, "t", ('{"id":"Rzft","arg":"pi/4"}',)],
7979
],

qualtran/rotation_synthesis/rings/_zw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ def to_zsqrt2(self) -> tuple[_zsqrt2.ZSqrt2, _zsqrt2.ZSqrt2, bool]:
207207
)
208208

209209
def real_zsqrt2(self) -> _zsqrt2.ZSqrt2:
210-
"""Returns \sqrt{2} * the real part of the element."""
210+
r"""Returns \sqrt{2} * the real part of the element."""
211211
a, _, need_w = self.to_zsqrt2()
212212
return a * _zsqrt2.SQRT_2 + _zsqrt2.ZSqrt2(need_w, 0)
213213

214214
def imag_zsqrt2(self) -> _zsqrt2.ZSqrt2:
215-
"""Returns \sqrt{2} * the imaginary part of the element."""
215+
r"""Returns \sqrt{2} * the imaginary part of the element."""
216216
_, b, need_w = self.to_zsqrt2()
217217
return b * _zsqrt2.SQRT_2 + _zsqrt2.ZSqrt2(need_w, 0)
218218

0 commit comments

Comments
 (0)