mirror of https://github.com/Qiskit/qiskit.git
parent
e0be97c10c
commit
5421ec6e69
|
@ -63,7 +63,7 @@ class Unroll3qOrMore(TransformationPass):
|
||||||
|
|
||||||
if self.target is not None:
|
if self.target is not None:
|
||||||
# Treat target instructions as global since this pass can be run
|
# Treat target instructions as global since this pass can be run
|
||||||
# prior to layout and routing we don't have phsyical qubits from
|
# prior to layout and routing we don't have physical qubits from
|
||||||
# the circuit yet
|
# the circuit yet
|
||||||
if node.name in self.target:
|
if node.name in self.target:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -71,9 +71,9 @@ class ApplyLayout(TransformationPass):
|
||||||
}
|
}
|
||||||
for qreg in dag.qregs.values():
|
for qreg in dag.qregs.values():
|
||||||
self.property_set["layout"].add_register(qreg)
|
self.property_set["layout"].add_register(qreg)
|
||||||
virtual_phsyical_map = layout.get_virtual_bits()
|
virtual_physical_map = layout.get_virtual_bits()
|
||||||
for node in dag.topological_op_nodes():
|
for node in dag.topological_op_nodes():
|
||||||
qargs = [q[virtual_phsyical_map[qarg]] for qarg in node.qargs]
|
qargs = [q[virtual_physical_map[qarg]] for qarg in node.qargs]
|
||||||
new_dag.apply_operation_back(node.op, qargs, node.cargs, check=False)
|
new_dag.apply_operation_back(node.op, qargs, node.cargs, check=False)
|
||||||
else:
|
else:
|
||||||
# First build a new layout object going from:
|
# First build a new layout object going from:
|
||||||
|
|
Loading…
Reference in New Issue