ChipTopology#

Module: exa.common.qcm_data.chip_topology

class ChipTopology(qubits, computational_resonators, couplers, probe_lines, *, variant='', mask_set_name='')#

Bases: object

Topology information for a chip (typically a QPU).

Represents the information found in a CHAD/CHEDDAR.

Parameters:
  • qubits (frozenset[str]) – Names of the qubits.

  • computational_resonators (frozenset[str]) – Names of the computational resonators.

  • couplers (frozenset[str]) – Mapping from coupler name to names of chip components it connects to.

  • probe_lines (frozenset[str]) – Mapping from probe line name to names of chip components it connects to.

  • variant (str) – Identifier of the QPU design variant.

  • mask_set_name (str) – Identifier of the QPU mask set name.

Attributes

mask_set_name

Identifier of the chip mask set name.

variant

Identifier of the chip design variant.

qubits

Names of the qubits of the chip.

qubits_sorted

Names of the qubits sorted in canonical order.

computational_resonators

Names of the computational resonators of the chip.

computational_resonators_sorted

Names of the computational resonators sorted in canonical order.

couplers

Names of the tunable couplers of the chip.

couplers_sorted

Names of the tunable couplers sorted in canonical order.

probe_lines

Names of the probe lines of the chip.

probe_lines_sorted

Names of the probe lines sorted in canonical order.

all_components

All the components on the chip.

coupler_to_components

Map from each coupler to all other components it connects to.

component_to_couplers

Map from each component to all couplers connected to it.

probe_line_to_components

Map from each probe line to all components it connects to.

component_to_probe_line

Map from each component to the probe line connected to it.

Methods

from_chad

Construct a ChipTopology instance from a CHAD.

from_chip_design_record

Construct a ChipTopology instance from a raw Chip design record.

get_all_common_resonators

Computational resonators connected to all the given qubits via a coupler.

get_common_computational_resonator

Convenience method for getting the name of a computational resonator which is connected to both specified qubit components via tunable couplers.

get_connected_coupler_map

Mapping from couplers that only connect to components, to the components they connect to.

get_connected_probe_lines

Get probelines that are connected to any of the given components.

get_connecting_couplers

Couplers that only connect to the given chip components, and connect at least two of them.

get_coupler_for

Common coupler for the given chip components (e.g. qubit or computational resonator).

get_neighbor_couplers

Couplers that connect to at least one of the given chip components.

get_neighbor_locus_components

Chip components that are connected to the given components by a coupler, but not included in them.

is_computational_resonator

True iff the given component is a computational resonator.

is_coupler

True iff the given component is a coupler.

is_probe_line

True iff the given component is a probe line.

is_qubit

True iff the given component is a qubit.

limit_values

Prunes the given mapping (e.g. a coupler_to_components map) to a subset.

mask_set_name: str#

Identifier of the chip mask set name.

variant: str#

Identifier of the chip design variant.

qubits: frozenset[str]#

Names of the qubits of the chip.

qubits_sorted: tuple[str, ...]#

Names of the qubits sorted in canonical order.

computational_resonators: frozenset[str]#

Names of the computational resonators of the chip.

computational_resonators_sorted: tuple[str, ...]#

Names of the computational resonators sorted in canonical order.

couplers: frozenset[str]#

Names of the tunable couplers of the chip.

couplers_sorted: tuple[str, ...]#

Names of the tunable couplers sorted in canonical order.

probe_lines: frozenset[str]#

Names of the probe lines of the chip.

probe_lines_sorted: tuple[str, ...]#

Names of the probe lines sorted in canonical order.

all_components: frozenset[str]#

All the components on the chip.

coupler_to_components: dict[str, tuple[str, ...]]#

Map from each coupler to all other components it connects to. The values are sorted.

component_to_couplers: dict[str, frozenset[str]]#

Map from each component to all couplers connected to it.

probe_line_to_components: dict[str, tuple[str, ...]]#

Map from each probe line to all components it connects to.

component_to_probe_line: dict[str, str]#

Map from each component to the probe line connected to it. Max 1 probe line per component is assumed. Components without connection to a probe line don’t appear here.

classmethod from_chip_design_record(chip_design_record)#

Construct a ChipTopology instance from a raw Chip design record.

Parameters:

chip_design_record (dict) – Chip design record as returned by Station Control.

Returns:

Corresponding chip topology.

Return type:

ChipTopology

classmethod from_chad(chad)#

Construct a ChipTopology instance from a CHAD. Use from_chip_design_record() if possible.

Parameters:

chad (CHAD) – Parsed CHAD model.

Returns:

Corresponding chip topology.

Return type:

ChipTopology

get_neighbor_couplers(components)#

Couplers that connect to at least one of the given chip components.

Parameters:

components (Iterable[str]) – some chip components, typically qubits and computational resonators

Returns:

couplers that connect to at least one of components

Return type:

set[str]

get_connecting_couplers(components)#

Couplers that only connect to the given chip components, and connect at least two of them.

Equivalent to returning the edges in the components-induced subgraph of the coupling topology.

Parameters:

components (Collection[str]) – some chip components, typically qubits and computational resonators

Returns:

couplers that connect to only members of components, and to at least two of them

Return type:

set[str]

get_coupler_for(component_1, component_2)#

Common coupler for the given chip components (e.g. qubit or computational resonator).

Parameters:
  • component_1 (str) – first component

  • component_2 (str) – second component

Returns:

the common coupler

Raises:

ValidationError – the given components have zero or more than one connecting coupler

Return type:

str

get_neighbor_locus_components(components)#

Chip components that are connected to the given components by a coupler, but not included in them.

Parameters:

components (Collection[str]) – some chip components, typically qubits and computational resonators

Returns:

components that are connected to components by a coupler, but not included in them

Return type:

set[str]

get_connected_probe_lines(components)#

Get probelines that are connected to any of the given components.

Parameters:

components (Collection[str])

Return type:

set[str]

get_connected_coupler_map(components)#

Mapping from couplers that only connect to components, to the components they connect to.

Additionally, the returned couplers must connect to at least two of components.

Parameters:

components (Collection[str]) – Components for which to find shared couplers.

Returns:

Mapping from coupler names to the names of components they connect to.

Return type:

dict[str, tuple[str, …]]

static limit_values(dct, limit_to)#

Prunes the given mapping (e.g. a coupler_to_components map) to a subset.

Used to prune e.g. coupler_to_components to a subset of relevant elements.

Parameters:
Returns:

The input mapping, but only with key-value pairs where the value intersects with limit_to.

Return type:

dict[str, Collection[str]]

is_qubit(component)#

True iff the given component is a qubit.

Parameters:

component (str)

Return type:

bool

is_coupler(component)#

True iff the given component is a coupler.

Parameters:

component (str)

Return type:

bool

is_probe_line(component)#

True iff the given component is a probe line.

Parameters:

component (str)

Return type:

bool

is_computational_resonator(component)#

True iff the given component is a computational resonator.

Parameters:

component (str)

Return type:

bool

get_common_computational_resonator(first_qubit, second_qubit)#

Convenience method for getting the name of a computational resonator which is connected to both specified qubit components via tunable couplers.

Parameters:
  • first_qubit (str) – The name of the first qubit.

  • second_qubit (str) –

    The name of the second qubit.

    The order of qubits does not matter, i.e. the first_qubit and second_qubit arguments are interchangeable.

Returns:

  • The name of the computational resonator that is connected to both inputted qubits via tunable couplers.

Raises:
  • - ValueError – If no computational resonator was found that is connected to both qubits via tunable

  • couplers.

Return type:

str

get_all_common_resonators(qubits)#

Computational resonators connected to all the given qubits via a coupler.

Parameters:

qubits (list[str]) – Qubit names.

Returns:

Names of the computational resonators neighboring all of qubits (can be an empty set).

Return type:

set[str]

Inheritance

Inheritance diagram of exa.common.qcm_data.chip_topology.ChipTopology