Skip to content

Commit b5c788e

Browse files
fix black
1 parent 07424f7 commit b5c788e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tensorcircuit/densitymatrix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def apply_general_gate(
213213
self._nodes.append(lgate)
214214
setattr(self, "state_tensor", None)
215215

216+
# TODO(@refraction-ray): support mpo gate: wait for unified abstraction on circuit
217+
216218
@staticmethod
217219
def apply_general_gate_delayed(
218220
gatef: Callable[[], Gate], name: Optional[str] = None

tests/test_interfaces.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def f(param):
4848

4949
param = torch.ones([4, n], requires_grad=True)
5050
l = f_jit_torch(param)
51-
l = l ** 2
51+
l = l**2
5252
l.backward()
5353

5454
pg = param.grad
@@ -96,7 +96,7 @@ def f2(paramzz, paramx):
9696
np.testing.assert_allclose(pg[0, 0], -0.41609, atol=1e-5)
9797

9898
def f3(x):
99-
return tc.backend.real(x ** 2)
99+
return tc.backend.real(x**2)
100100

101101
f3_torch = tc.interfaces.torch_interface(f3)
102102
param3 = torch.ones([2], dtype=torch.complex64, requires_grad=True)
@@ -116,7 +116,7 @@ def f3(x):
116116
@pytest.mark.parametrize("backend", [lf("tfb"), lf("jaxb")])
117117
def test_torch_interface_dlpack_complex(backend):
118118
def f3(x):
119-
return tc.backend.real(x ** 2)
119+
return tc.backend.real(x**2)
120120

121121
f3_torch = tc.interfaces.torch_interface(f3, enable_dlpack=True)
122122
param3 = torch.ones([2], dtype=torch.complex64, requires_grad=True)

0 commit comments

Comments
 (0)