diff --git a/src/qibo/models/circuit.py b/src/qibo/models/circuit.py index e4ea88ee9c..48523eb6cf 100644 --- a/src/qibo/models/circuit.py +++ b/src/qibo/models/circuit.py @@ -301,7 +301,6 @@ def wire_names(self, wire_names: Union[list, dict]): ) self._wire_names = wire_names.copy() - # self._wire_names = wire_names elif isinstance(wire_names, dict): if len(wire_names.keys()) > self.nqubits: raise_error( diff --git a/src/qibo/transpiler/pipeline.py b/src/qibo/transpiler/pipeline.py index cdbe2a8567..c2f9e2c26a 100644 --- a/src/qibo/transpiler/pipeline.py +++ b/src/qibo/transpiler/pipeline.py @@ -54,15 +54,6 @@ def assert_circuit_equivalence( for _ in range(ntests) ] - # original: list = original_circuit.wire_names - # transpiled: list = transpiled_circuit.wire_names - # initial_map = [0, 1, 2, 3, 4] - # initial_map = [original.index(qubit) for qubit in transpiled] - # reordered_test_states = [] - # reordered_test_states = [ - # _transpose_qubits(initial_state, initial_map) for initial_state in test_states - # ] - ordering = list(final_map.values()) for i, state in enumerate(test_states): @@ -70,7 +61,6 @@ def assert_circuit_equivalence( original_circuit, initial_state=state ).state() final_state = backend.execute_circuit( - # transpiled_circuit, initial_state=reordered_test_states[i] transpiled_circuit, initial_state=state, ).state() diff --git a/src/qibo/transpiler/placer.py b/src/qibo/transpiler/placer.py index 963d47749d..f1ad7c6005 100644 --- a/src/qibo/transpiler/placer.py +++ b/src/qibo/transpiler/placer.py @@ -201,9 +201,6 @@ def __call__(self, circuit: Circuit): Args: circuit (:class:`qibo.models.circuit.Circuit`): circuit to be transpiled. - - Returns: - (dict): physical to logical qubit mapping. """ gates_qubits_pairs = _find_gates_qubits_pairs(circuit) if len(gates_qubits_pairs) < 3: @@ -236,8 +233,6 @@ def __call__(self, circuit: Circuit): break circuit.wire_names = sorted(result.mapping, key=lambda k: result.mapping[k]) - # sorted_result = dict(sorted(result.mapping.items())) - # circuit.wire_names = sorted(sorted_result, key=sorted_result.get) class Random(Placer): @@ -264,9 +259,6 @@ def __call__(self, circuit): Args: circuit (:class:`qibo.models.circuit.Circuit`): Circuit to be transpiled. - - Returns: - (dict): physical-to-logical qubit mapping. """ _, local_state = _check_backend_and_local_state(self.seed, backend=None) gates_qubits_pairs = _find_gates_qubits_pairs(circuit) @@ -352,15 +344,10 @@ def __call__(self, circuit: Circuit): Args: circuit (:class:`qibo.models.circuit.Circuit`): circuit to be transpiled. - - Returns: - (dict): physical to logical qubit mapping. """ self.routing_algorithm.connectivity = self.connectivity new_circuit = self._assemble_circuit(circuit) - final_placement = self._routing_step(new_circuit) - - # return final_placement + self._routing_step(new_circuit) def _assemble_circuit(self, circuit: Circuit): """Assemble a single circuit to apply Reverse Traversal placement based on depth.