---
title: QkSabreLayoutOptions (latest version)
description: API reference for QkSabreLayoutOptions in the latest version of qiskit-c
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-c/qk-sabre-layout-options
---

# 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.

**Returns**

A `QkSabreLayoutOptions` object with default settings.
