diff --git a/qiskit/_openquantumcompiler.py b/qiskit/_openquantumcompiler.py index 27eb57d72b46..44f1b2c19acd 100644 --- a/qiskit/_openquantumcompiler.py +++ b/qiskit/_openquantumcompiler.py @@ -37,7 +37,7 @@ def compile(qasm_circuit, basis_gates='u1,u2,u3,cx,id', coupling_map=None, initial_layout (dict): A mapping of qubit to qubit:: { - ("q", strart(int)): ("q", final(int)), + ("q", start(int)): ("q", final(int)), ... } eg. diff --git a/qiskit/mapper/_mapping.py b/qiskit/mapper/_mapping.py index c23f1a13d79b..67407da0aadb 100644 --- a/qiskit/mapper/_mapping.py +++ b/qiskit/mapper/_mapping.py @@ -332,8 +332,8 @@ def swap_mapper(circuit_graph, coupling_graph, # Schedule the input circuit layerlist = circuit_graph.layers() logger.debug("schedule:") - for i in range(len(layerlist)): - logger.debug(" %d: %s", i, layerlist[i]["partition"]) + for i,v in enumerate(layerlist): + logger.debug(" %d: %s", (i, v["partition"])) if initial_layout is not None: # Check the input layout @@ -372,13 +372,6 @@ def swap_mapper(circuit_graph, coupling_graph, logger.debug("swap_mapper: success_flag=%s,best_d=%s,trivial_flag=%s", success_flag, str(best_d), trivial_flag) - # If this layer is only single-qubit gates, - # and we have yet to see multi-qubit gates, - # continue to the next iteration - if trivial_flag and first_layer: - logger.debug("swap_mapper: skip to next layer") - continue - # If this fails, try one gate at a time in this layer if not success_flag: logger.debug("swap_mapper: failed, layer %d, "