---
title: aliases (latest version)
description: API reference for samplomatic.aliases in the latest version of samplomatic
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/samplomatic/aliases
---

# samplomatic.aliases

Type Aliases

### samplomatic.aliases.EdgeLayout

A map from graph edge indices to coordinate arrays specifying a curved path.

The arrays need to have at least one entry so that there is somewhere to put the edge’s arrow. The arrays need not include the end-points; those are inferred from a node layout.

alias of [`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict)\[[`int`](https://docs.python.org/3/builtins/functions.html#int), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)\[[`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple)\[[`int`](https://docs.python.org/3/builtins/functions.html#int), 2], [`dtype`](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype)\[[`float`](https://docs.python.org/3/builtins/functions.html#float)]]]

### samplomatic.aliases.GraphLayout

Type: [`TypeAlias`](https://docs.python.org/3/library/typing.html#typing.TypeAlias)

Default value: `dict[int, tuple[float, float]] | tuple[dict[int, tuple[float, float]], dict[int, numpy.ndarray[tuple[int, 2], numpy.dtype[float]]]]`

A node layout, or a node layout and an edge layout.

The graph plotter will infer linear edges in the former case.

### LayoutMethod

*class* `samplomatic.aliases.LayoutMethod(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/aliases.py#L91-L96)

A callable that accepts a graph and returns a coordinate layout.

### samplomatic.aliases.LayoutPresets

Preset layout methods for graph plotting.

- `'auto'`: Use some graphviz method if installed, use `'spring'` otherwise.
- `'graphviz'`: Use graphviz with dot and splined edges.
- `'graphviz_curved'`: Use graphviz with dot and curved edges.
- `'graphviz_line'`: Use graphviz with dot and straight edges.
- `'spring'`: Use the `rustworkx` spring layout method.

alias of [`Literal`](https://docs.python.org/3/library/typing.html#typing.Literal)\[‘auto’, ‘spring’, ‘graphviz’, ‘graphviz\_curved’, ‘graphviz\_line’]

### samplomatic.aliases.NodeLayout

A map from graph node indices to $(x, y)$ coordinates.

alias of [`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict)\[[`int`](https://docs.python.org/3/builtins/functions.html#int), [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/builtins/functions.html#float), [`float`](https://docs.python.org/3/builtins/functions.html#float)]]

### NodeRanker

*class* `samplomatic.aliases.NodeRanker(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/aliases.py#L82-L88)

Specifies a node ranking that can be used by layout methods to group nodes topologically.

A return value of `None` signifies no rank specified.
