ChipTopology#
Module: exa.common.qcm_data.chip_topology
- class ChipTopology(qubits, computational_resonators, couplers, probe_lines, *, variant='', mask_set_name='')#
Bases:
objectTopology information for a chip (typically a QPU).
Represents the information found in a CHAD/CHEDDAR.
- Parameters:
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
Identifier of the chip mask set name.
Identifier of the chip design variant.
Names of the qubits of the chip.
Names of the qubits sorted in canonical order.
Names of the computational resonators of the chip.
Names of the computational resonators sorted in canonical order.
Names of the tunable couplers of the chip.
Names of the tunable couplers sorted in canonical order.
Names of the probe lines of the chip.
Names of the probe lines sorted in canonical order.
All the components on the chip.
Map from each coupler to all other components it connects to.
Map from each component to all couplers connected to it.
Map from each probe line to all components it connects to.
Map from each component to the probe line connected to it.
Methods
Construct a ChipTopology instance from a CHAD.
Construct a ChipTopology instance from a raw Chip design record.
Computational resonators connected to all the given qubits via a coupler.
Convenience method for getting the name of a computational resonator which is connected to both specified qubit components via tunable couplers.
Mapping from couplers that only connect to
components, to the components they connect to.Get probelines that are connected to any of the given components.
Couplers that only connect to the given chip components, and connect at least two of them.
Common coupler for the given chip components (e.g. qubit or computational resonator).
Couplers that connect to at least one of the given chip components.
Chip components that are connected to the given components by a coupler, but not included in them.
True iff the given component is a computational resonator.
True iff the given component is a coupler.
True iff the given component is a probe line.
True iff the given component is a qubit.
Prunes the given mapping (e.g. a coupler_to_components map) to a subset.
- computational_resonators_sorted: tuple[str, ...]#
Names of the computational resonators sorted in canonical order.
- 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:
- 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:
- get_neighbor_couplers(components)#
Couplers that connect to at least one of the given chip components.
- 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:
- get_coupler_for(component_1, component_2)#
Common coupler for the given chip components (e.g. qubit or computational resonator).
- Parameters:
- Returns:
the common coupler
- Raises:
ValidationError – the given components have zero or more than one connecting coupler
- Return type:
- 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
componentsby a coupler, but not included in them- Return type:
- get_connected_probe_lines(components)#
Get probelines that are connected to any of the given components.
- Parameters:
components (Collection[str])
- Return type:
- 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.
- 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_componentsto a subset of relevant elements.- Parameters:
dct (Mapping[str, Collection[str]]) – Mapping to prune.
limit_to (Collection[str]) – At least one of these components must appear in the mapping values.
- 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.
- is_coupler(component)#
True iff the given component is a coupler.
- is_probe_line(component)#
True iff the given component is a probe line.
- is_computational_resonator(component)#
True iff the given component is a computational resonator.
- 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:
- 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:
Inheritance
