From a5e4a090253c2a84b42976b6b5b51776a1254e94 Mon Sep 17 00:00:00 2001 From: sjdilkes Date: Tue, 29 Aug 2023 10:03:40 +0100 Subject: [PATCH] black format --- pytket/pytket/backends/backend.py | 2 -- pytket/pytket/circuit/decompose_classical.py | 2 +- pytket/tests/classical_test.py | 1 - pytket/tests/qasm_test.py | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pytket/pytket/backends/backend.py b/pytket/pytket/backends/backend.py index cb76d6c9ce..cd4699cba2 100644 --- a/pytket/pytket/backends/backend.py +++ b/pytket/pytket/backends/backend.py @@ -107,7 +107,6 @@ def valid_circuit(self, circuit: Circuit) -> bool: def _check_all_circuits( self, circuits: Iterable[Circuit], nomeasure_warn: Optional[bool] = None ) -> bool: - if nomeasure_warn is None: nomeasure_warn = not ( self._supports_state @@ -265,7 +264,6 @@ def process_circuits( valid_check: bool = True, **kwargs: KwargTypes, ) -> List[ResultHandle]: - """ Submit circuits to the backend for running. The results will be stored in the backend's result cache to be retrieved by the corresponding diff --git a/pytket/pytket/circuit/decompose_classical.py b/pytket/pytket/circuit/decompose_classical.py index c38635254b..e0ce34dadd 100644 --- a/pytket/pytket/circuit/decompose_classical.py +++ b/pytket/pytket/circuit/decompose_classical.py @@ -337,7 +337,7 @@ def _decompose_expressions(circ: Circuit) -> Tuple[Circuit, bool]: modified = True continue if optype == OpType.Barrier: - # add_gate doesn't work for metaops + # add_gate doesn't work for metaops newcirc.add_barrier(args) else: newcirc.add_gate(op, args, **kwargs) diff --git a/pytket/tests/classical_test.py b/pytket/tests/classical_test.py index 95e7c162b7..988f9b0704 100644 --- a/pytket/tests/classical_test.py +++ b/pytket/tests/classical_test.py @@ -486,7 +486,6 @@ def qubit_register( index=strategies.integers(min_value=0, max_value=32), ) def test_registers(reg: Union[BitRegister, QubitRegister], index: int) -> None: - unit_type = Qubit if type(reg) is QubitRegister else Bit if index < reg.size: assert reg[index] == unit_type(reg.name, index) diff --git a/pytket/tests/qasm_test.py b/pytket/tests/qasm_test.py index 36b47fac34..ce11817d84 100644 --- a/pytket/tests/qasm_test.py +++ b/pytket/tests/qasm_test.py @@ -210,7 +210,7 @@ def test_conditional_gates() -> None: circ.Measure(0, 0) circ.Measure(1, 1) circ.Z(0, condition_bits=[0, 1], condition_value=2) - circ._add_conditional_barrier([0,1],[0],[1], 1) + circ._add_conditional_barrier([0, 1], [0], [1], 1) circ.Measure(0, 0, condition_bits=[0, 1], condition_value=1) qasm_out = str(curr_file_path / "qasm_test_files/testout5.qasm") circuit_to_qasm(circ, qasm_out)