Skip to content

Commit

Permalink
Solving unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillermoAbadLopez committed Oct 31, 2024
1 parent b480448 commit 52dac2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/qililab/digital/circuit_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Circuit Transpiler class"""

import networkx as nx
from qibo import gates
from qibo.models import Circuit
from qibo.transpiler.placer import Placer
from qibo.transpiler.router import Router
Expand Down Expand Up @@ -226,7 +225,7 @@ def circuit_to_native(self, circuit: Circuit) -> Circuit:

return new_circuit

def optimize_transpilation(self, circuit: Circuit) -> list[gates.Gate]:
def optimize_transpilation(self, circuit: Circuit) -> Circuit:
"""Optimizes transpiled circuit by applying virtual Z gates.
This is done by moving all RZ to the left of all operators as a single RZ. The corresponding cumulative rotation
Expand Down
3 changes: 2 additions & 1 deletion tests/digital/test_circuit_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ def test_optimize_transpilation(self, digital_settings):
circuit.add(test_gates)

# check that lists are the same
optimized_gates = transpiler.optimize_transpilation(circuit)
circuit = transpiler.optimize_transpilation(circuit)
optimized_gates = list(circuit.queue)
for gate_r, gate_opt in zip(result_gates, optimized_gates):
assert gate_r.name == gate_opt.name
assert gate_r.parameters == gate_opt.parameters
Expand Down

0 comments on commit 52dac2a

Please sign in to comment.