mqt.ionshuttler.linear.architecture

Hardware layout and processing capabilities for a linear ion chain.

Module Contents

IMPLICIT_PROCESSING_ZONE = 'all_sites'
class Architecture[source]

Describe the available sites, processing zones, and control capabilities.

num_sites: int
processing_zones: Mapping[str, Sequence[int]] | None = None
field_profile: FieldProfile | None = None
supported_action_types: tuple[type[Action], ...]
valid_two_qubit_site_pairs: tuple[tuple[int, int], ...]
__post_init__() → None[source]

Check the hardware description and store zone sites in order.

Raises:

ValueError – If the site count, zones, or field profile are invalid.

get_processing_zone(site: int) → str | None[source]

Return the processing zone containing a site, if any.

field_at(site: int) → float[source]

Return the configured field value at one site.

has_nontrivial_field_profile() → bool[source]

Return whether any site differs from the unit field profile.

supports(action_type: type[Action]) → bool[source]

Return whether the hardware exposes an action type.

sites_share_processing_zone(*sites: int) → bool[source]

Return whether all supplied sites belong to one processing zone.

initial_pzs_busy_until() → tuple[tuple[str, int], ...][source]

Return every processing zone as available at the start of a schedule.

to_dict() → dict[str, object][source]

Return JSON-compatible architecture metadata.

to_json() → str[source]

Serialize architecture metadata as JSON.

Returns:

The serialized architecture object.

classmethod from_dict(data: object, *, action_types: Sequence[type[Action]] | None = None) → Architecture[source]

Construct an architecture from a JSON-style mapping.

Parameters:
  • data – Architecture mapping.

  • action_types – Additional action classes available when resolving the serialized supported-action catalog.

Returns:

A validated architecture.

Raises:
  • TypeError – If the architecture or site count has the wrong type.

  • ValueError – If the mapping has an invalid shape or values.

classmethod from_json(raw: str, *, action_types: Sequence[type[Action]] | None = None) → Architecture[source]

Deserialize an architecture from JSON.

Returns:

A validated architecture.

classmethod load(filename: str | Path, *, action_types: Sequence[type[Action]] | None = None) → Architecture[source]

Load an architecture from a UTF-8 JSON file.

Returns:

A validated architecture.