From af31f46e49ac0b2a88be28241d1a81e781c18db7 Mon Sep 17 00:00:00 2001 From: "Davide Gessa (dakk)" Date: Thu, 7 Dec 2023 09:07:46 +0100 Subject: [PATCH] fix tox --- qlasskit/algorithms/deutschjozsa.py | 2 +- qlasskit/algorithms/grover.py | 2 +- qlasskit/algorithms/simon.py | 2 +- qlasskit/qcircuit/qcircuit.py | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qlasskit/algorithms/deutschjozsa.py b/qlasskit/algorithms/deutschjozsa.py index a2771330..6c9ccfcc 100644 --- a/qlasskit/algorithms/deutschjozsa.py +++ b/qlasskit/algorithms/deutschjozsa.py @@ -36,7 +36,7 @@ def __init__( self.f: QlassF = f self.search_space_size = len(f.args[0]) - self._qcircuit = QCircuit(self.f.num_qubits, name=f"deutsch_" + f.name) + self._qcircuit = QCircuit(self.f.num_qubits, name=f"deutsch_{f.name}") self._f_circuit = self.f.circuit() diff --git a/qlasskit/algorithms/grover.py b/qlasskit/algorithms/grover.py index a99aaa43..a23058ff 100644 --- a/qlasskit/algorithms/grover.py +++ b/qlasskit/algorithms/grover.py @@ -52,7 +52,7 @@ def __init__( self.n_iterations = n_iterations - self._qcircuit = QCircuit(self.search_space_size, name=f"grover_" + oracle.name) + self._qcircuit = QCircuit(self.search_space_size, name=f"grover__{oracle.name}") # State preparation self._qcircuit.barrier(label="s") diff --git a/qlasskit/algorithms/simon.py b/qlasskit/algorithms/simon.py index 0e77a7ab..fe4f0c6e 100644 --- a/qlasskit/algorithms/simon.py +++ b/qlasskit/algorithms/simon.py @@ -34,7 +34,7 @@ def __init__( self.f: QlassF = f self.search_space_size = len(f.args[0]) - self._qcircuit = QCircuit(self.f.num_qubits, name=f"simon_" + f.name) + self._qcircuit = QCircuit(self.f.num_qubits, name=f"simon_{f.name}") # State preparation self._qcircuit.barrier(label="s") diff --git a/qlasskit/qcircuit/qcircuit.py b/qlasskit/qcircuit/qcircuit.py index caeb9423..2d54acba 100644 --- a/qlasskit/qcircuit/qcircuit.py +++ b/qlasskit/qcircuit/qcircuit.py @@ -53,7 +53,9 @@ def get_key_by_index(self, i: int): def __repr__(self): """Return a string representation of the QCircuit""" - return f"QCircuit<{self.name}>({self.num_gates} gates, {self.num_qubits} qubits)" + return ( + f"QCircuit<{self.name}>({self.num_gates} gates, {self.num_qubits} qubits)" + ) def __contains__(self, key: Union[str, Symbol, int]): """Return True if the circuit contain a qubit with a given name/symbol"""