Skip to main contentIBM Quantum Documentation Mirror

QkSabreLayoutOptions

When running the qk_transpiler_pass_standalone_sabre_layout function this type defines the options for running the pass.


Data Types

QkSabreLayoutOptions

struct QkSabreLayoutOptions

The options for running qk_transpiler_pass_standalone_sabre_layout. This struct is used as an input to control the behavior of the layout and routing algorithms.

size_t max_iterations

The number of forward-backward iterations in the sabre routing algorithm

size_t num_swap_trials

The number of trials to run of the sabre routing algorithm for each iteration. When > 1 the trial that routing trial that results in the output with the fewest swap gates will be selected.

size_t num_random_trials

The number of random layout trials to run. The trial that results in the output with the fewest swap gates will be selected.

uint64_t seed

A seed value for the pRNG used internally.


Functions

qk_sabre_layout_options_default

QkSabreLayoutOptions qk_sabre_layout_options_default(void)

Build a default sabre layout options object. This builds a sabre layout with max_iterations set to 4, both num_swap_trials and num_random_trials set to 20, and the seed selected by a RNG seeded from system entropy.