@@ -76,10 +76,10 @@ class SabreLayout(TransformationPass):
76
76
77
77
In addition to starting with a random initial `Layout` the pass can also take in
78
78
an additional list of starting layouts which will be used for additional
79
- trials. If the ``sabre_starting_layout `` is present in the property set
79
+ trials. If the ``sabre_starting_layouts `` is present in the property set
80
80
when this pass is run, that will be used for additional trials. There will still
81
81
be ``layout_trials`` of full random starting layouts run and the contents of
82
- ``sabre_starting_layout `` will be run in addition to those. The output which results
82
+ ``sabre_starting_layouts `` will be run in addition to those. The output which results
83
83
in the lowest amount of swap gates (whether from the random trials or the property
84
84
set starting point) will be used. The value for this property set field should be a
85
85
list of :class:`.Layout` objects representing the starting layouts to use. If a
@@ -89,7 +89,7 @@ class SabreLayout(TransformationPass):
89
89
Property Set Fields Read
90
90
------------------------
91
91
92
- ``sabre_starting_layout `` (``list[Layout]``)
92
+ ``sabre_starting_layouts `` (``list[Layout]``)
93
93
An optional list of :class:`~.Layout` objects to use for additional layout trials. This is
94
94
in addition to the full random trials specified with the ``layout_trials`` argument.
95
95
@@ -261,9 +261,9 @@ def run(self, dag):
261
261
else :
262
262
target = self .coupling_map
263
263
inner_run = self ._inner_run
264
- if "sabre_starting_layout " in self .property_set :
264
+ if "sabre_starting_layouts " in self .property_set :
265
265
inner_run = functools .partial (
266
- self ._inner_run , starting_layout = self .property_set ["sabre_starting_layout " ]
266
+ self ._inner_run , starting_layouts = self .property_set ["sabre_starting_layouts " ]
267
267
)
268
268
components = disjoint_utils .run_pass_over_connected_components (dag , target , inner_run )
269
269
self .property_set ["layout" ] = Layout (
@@ -346,7 +346,7 @@ def run(self, dag):
346
346
disjoint_utils .combine_barriers (mapped_dag , retain_uuid = False )
347
347
return mapped_dag
348
348
349
- def _inner_run (self , dag , coupling_map , starting_layout = None ):
349
+ def _inner_run (self , dag , coupling_map , starting_layouts = None ):
350
350
if not coupling_map .is_symmetric :
351
351
# deepcopy is needed here to avoid modifications updating
352
352
# shared references in passes which require directional
@@ -357,11 +357,11 @@ def _inner_run(self, dag, coupling_map, starting_layout=None):
357
357
dist_matrix = coupling_map .distance_matrix
358
358
original_qubit_indices = {bit : index for index , bit in enumerate (dag .qubits )}
359
359
partial_layouts = []
360
- if starting_layout is not None :
360
+ if starting_layouts is not None :
361
361
coupling_map_reverse_mapping = {
362
362
coupling_map .graph [x ]: x for x in coupling_map .graph .node_indices ()
363
363
}
364
- for layout in starting_layout :
364
+ for layout in starting_layouts :
365
365
virtual_bits = layout .get_virtual_bits ()
366
366
out_layout = [None ] * len (dag .qubits )
367
367
for bit , phys in virtual_bits .items ():
0 commit comments