mqt.ionshuttler.multi_shuttler.main

Module Contents

validate_conflict_resolution_mode(config: Mapping[str, Any]) str[source]

Validate and normalize the conflict-resolution mode from config.

Parameters:

config – Parsed user configuration.

Returns:

Normalized mode string (“cycles”, “paths”, or “hybrid”).

Raises:
  • TypeError – If the value is present but not a string.

  • ValueError – If the value is a string but unsupported.

validate_gate_pz_assignment(config: Mapping[str, Any]) dict[int, str][source]

Validate and normalize an optional explicit gate-to-PZ mapping.

Parameters:

config – Parsed user configuration.

Returns:

Normalized gate-id to PZ mapping. Missing values normalize to an empty dict.

Raises:

TypeError – If the mapping or any key/value types are invalid.

validate_use_fine_grained_gate_partition(config: Mapping[str, Any]) bool[source]

Validate and normalize the opt-in fine-grained partitioning flag.

validate_fine_grained_gate_partition_request(config: Mapping[str, Any], gate_pz_assignment: Mapping[int, str]) bool[source]

Validate the optional fine-grained orchestration request as one unit.

compute_fine_grained_gate_assignment(sequence: list[int], gate_info: dict[int, Any], pzs: list[ProcessingZone]) dict[int, str][source]

Compute a gate-to-PZ assignment using the default fine-grained settings.

main(config: dict[str, Any]) int[source]

Run the configured multi-shuttler compiler and scheduler.

The configuration must provide the architecture, algorithm name, circuit source, and exactly one ion-count mode. gate_pz_assignment supplies explicit gate-to-zone choices, while use_fine_grained_gate_partition requests automatic assignments; the two modes are mutually exclusive.

Parameters:

config – Runtime, architecture, circuit, and partitioning configuration.

Returns:

Zero when compilation and scheduling complete successfully.

Raises:
  • TypeError – If a typed configuration field has an invalid type.

  • ValueError – If required configuration is missing, inconsistent, or invalid.

  • FileNotFoundError – If the configured circuit input cannot be found.