Skip to content

Commit

Permalink
we already have this problem solved in the passmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
Luciano Bello committed Mar 20, 2020
1 parent b11d943 commit caa5eff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qiskit/compiler/transpile.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def callback_func(**kwargs):
(isinstance(circuits, list) and all(isinstance(c, Schedule) for c in circuits)):
return circuits

if pass_manager:
return pass_manager.run(circuits, output_name=output_name, callback=callback)

if optimization_level is None:
config = user_config.get_config()
optimization_level = config.get('transpile_optimization_level', None)
Expand Down Expand Up @@ -188,7 +191,7 @@ def callback_func(**kwargs):
'in {} '.format(circuit.name) +
'is greater than maximum ({}) '.format(max_qubits) +
'in the coupling_map')
# Transpile circuits in parallel

circuits = parallel_map(_transpile_circuit, list(zip(circuits, transpile_args)))

if len(circuits) == 1:
Expand Down

0 comments on commit caa5eff

Please sign in to comment.