Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Mar 27, 2024
1 parent e0e3613 commit 748b801
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions test/cutting/qpd/test_qpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ def test_decompose_qpd_instructions(self):
circ_compare.add_register(ClassicalRegister(0, name="qpd_measurements"))
self.assertEqual(decomp_circ, circ_compare)
with self.subTest("Single QPD gate with translation"):
eagle_basis_gate_set = {'id', 'rz', 'sx', 'x', 'measure'}
eagle_basis_gate_set = {"id", "rz", "sx", "x", "measure"}
circ = QuantumCircuit(2)
qpd_basis = QPDBasis.from_instruction(RXXGate(np.pi / 3))
qpd_gate = TwoQubitQPDGate(qpd_basis)
circ.data.append(CircuitInstruction(qpd_gate, qubits=[0, 1]))
decomp_circ = decompose_qpd_instructions(circ, [[0]], map_ids=[1], translate_to_qpu="eagle")
decomp_circ = decompose_qpd_instructions(
circ, [[0]], map_ids=[1], translate_to_qpu="eagle"
)
for inst in decomp_circ.data:
assert inst.operation.name in eagle_basis_gate_set
with self.subTest("Incorrect map index size"):
Expand Down
7 changes: 5 additions & 2 deletions test/cutting/test_cutting_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_generate_cutting_experiments(self):
for circ in subexperiments["A"]:
assert isinstance(circ, QuantumCircuit)
with self.subTest("translation"):
eagle_basis_gate_set = {'id', 'rz', 'sx', 'x', 'measure'}
eagle_basis_gate_set = {"id", "rz", "sx", "x", "measure"}
qc = QuantumCircuit(2)
qc.append(
TwoQubitQPDGate(QPDBasis.from_instruction(CXGate()), label="cut_cx"),
Expand All @@ -102,7 +102,10 @@ def test_generate_cutting_experiments(self):
(-0.5, WeightType.EXACT),
]
subexperiments, coeffs = generate_cutting_experiments(
qc, PauliList(["ZZ"]), np.inf, translate_to_qpu="eagle",
qc,
PauliList(["ZZ"]),
np.inf,
translate_to_qpu="eagle",
)
assert coeffs == comp_coeffs
assert len(coeffs) == len(subexperiments)
Expand Down

0 comments on commit 748b801

Please sign in to comment.