Skip to content

Commit 78c18f3

Browse files
committedApr 21, 2023
blacked
1 parent 5ce7d21 commit 78c18f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎tests/test_circuit.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1516,14 +1516,16 @@ def test_get_positional_logical_mapping():
15161516
c.measure_instruction(0)
15171517
assert c.get_positional_logical_mapping() == {0: 2, 1: 0}
15181518

1519+
15191520
@pytest.mark.parametrize("backend", [lf("tfb"), lf("jaxb")])
15201521
def test_inverse_jit(backend):
15211522
K = tc.backend
1523+
15221524
def simple_ansatz(param):
15231525
c = tc.Circuit(3)
15241526
for i in range(3):
1525-
c.cx(i, (i+1)%3)
1526-
c.rzz(i, (i+1)%3, theta=param[i])
1527+
c.cx(i, (i + 1) % 3)
1528+
c.rzz(i, (i + 1) % 3, theta=param[i])
15271529
c1 = c.inverse()
15281530
c2 = tc.Circuit(3)
15291531
c2.x(1)
@@ -1533,4 +1535,4 @@ def simple_ansatz(param):
15331535
v_ansatz = K.jit(K.vvag(simple_ansatz))
15341536
vs, gs = v_ansatz(K.ones([2, 3], dtype="float32"))
15351537
assert K.shape_tuple(gs) == (2, 3)
1536-
np.testing.assert_allclose(K.numpy(vs), -1.*K.ones([2]), atol=1e-5)
1538+
np.testing.assert_allclose(K.numpy(vs), -1.0 * K.ones([2]), atol=1e-5)

0 commit comments

Comments
 (0)
Please sign in to comment.