iqm.benchmarks.utils_plots.GraphPositions#

class iqm.benchmarks.utils_plots.GraphPositions#

Bases: object

A class to store and generate graph positions for different chip layouts.

This class contains predefined node positions for various quantum chip topologies and provides methods to generate positions for different layout types.

garnet_positions#

Mapping of node indices to (x,y) positions for Garnet chip.

Type:

Dict[int, Tuple[float, float]]

deneb_positions#

Mapping of node indices to (x,y) positions for Deneb chip.

Type:

Dict[int, Tuple[float, float]]

predefined_stations#

Mapping of chip names to their position dictionaries.

Type:

Dict[str, Dict[int, Tuple[float, float]]]

Attributes

deneb_positions

emerald_positions

garnet_positions

max_qubit_number

node

predefined_stations

previous_nodes

sirius_positions

Methods

__eq__(other)

Return self==value.

__repr__()

Return repr(self).

create_positions(graph[, topology])

Generate node positions for a given graph and topology.

get_positions([station, graph, num_qubits])

Get predefined positions for a specific station or generate positions for a custom graph.

static create_positions(graph: PyGraph, topology: Literal['star', 'crystal'] | None = None) Dict[int, Tuple[float, float]]#

Generate node positions for a given graph and topology.

Parameters:
  • graph (PyGraph) – The graph to generate positions for.

  • topology (Optional[Literal["star", "crystal"]]) – The type of layout to generate. Must be either “star” or “crystal”.

Returns:

A dictionary mapping node indices to (x,y) coordinates.

Return type:

Dict[int, Tuple[float, float]]

static get_positions(station: str | None = None, graph: PyGraph | None = None, num_qubits: int | None = None) Dict[int, Tuple[float, float]]#

Get predefined positions for a specific station or generate positions for a custom graph.

Parameters:
  • station (Optional[str]) – The name of the station to get predefined positions for. If None, positions will be generated algorithmically.

  • graph (Optional[PyGraph]) – The graph to generate positions for if no predefined positions exist. Used only when station is None and num_qubits doesn’t match any predefined layout.

  • num_qubits (Optional[int]) – The number of qubits to get a layout for. If matches a known system, predefined positions will be used.

Returns:

A dictionary mapping node indices to (x,y) coordinates.

Return type:

Dict[int, Tuple[float, float]]

Raises:

ValueError – If none of station, graph, or num_qubits are provided, or if num_qubits doesn’t match any predefined layout and graph is None.