Skip to content

Commit 76db2ca

Browse files
committed
Merge branch '1.0.3' of github.com:BQSKit/bqskit into 1.0.3
2 parents 8df61fd + 1c379f7 commit 76db2ca

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

tests/bqskitrs/test_grad.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
from __future__ import annotations
2+
13
import numpy as np
2-
from bqskit import Circuit
3-
from bqskit.ir.gates import CNOTGate, U3Gate
44
from bqskitrs import Circuit as CircuitRS
55

6+
from bqskit import Circuit
7+
from bqskit.ir.gates import CNOTGate
8+
from bqskit.ir.gates import U3Gate
9+
10+
611
def test_basic() -> None:
712
circuit = Circuit(3)
813
for _ in range(10):
914
for i in range(2):
10-
circuit.append_gate(CNOTGate(), (i, i+1))
15+
circuit.append_gate(CNOTGate(), (i, i + 1))
1116
circuit.append_gate(U3Gate(), i)
12-
circuit.append_gate(U3Gate(), i+1)
17+
circuit.append_gate(U3Gate(), i + 1)
1318
crs = CircuitRS(circuit)
14-
d, dM = crs.get_unitary_and_grad([0]*(2*10*6))
15-
od, odM = circuit.get_unitary_and_grad([0]*(2*10*6))
19+
d, dM = crs.get_unitary_and_grad([0] * (2 * 10 * 6))
20+
od, odM = circuit.get_unitary_and_grad([0] * (2 * 10 * 6))
1621
assert np.allclose(d, od)
1722
assert np.allclose(dM, odM)

0 commit comments

Comments
 (0)