bloqade.lanes.arch.spec.ArchSpec
classArchSpec¶source
bloqade.lanes.arch.spec.ArchSpec
Bases: RustWrapper[_RustArchSpec]
Architecture specification for a quantum device.
class ArchSpec(inner: _RustArchSpec)Parameters
| Name | Type | Description |
|---|---|---|
inner | _RustArchSpec |
propertywords¶source
bloqade.lanes.arch.spec.ArchSpec.words
propertypaths¶source
bloqade.lanes.arch.spec.ArchSpec.paths
paths: MappingProxyType[LaneAddress, tuple[tuple[float, float], ...]]Transport path waypoints keyed by LaneAddress.
Derived from the Rust ArchSpec.paths on first access.
methoditer_all_lanes¶source
bloqade.lanes.arch.spec.ArchSpec.iter_all_lanes
def iter_all_lanes() -> Iterator[LaneAddress]Yield every valid lane address in the architecture.
Enumerates site-bus, word-bus, and zone-bus lanes in both forward
and backward directions. Used by
MoveMetricCalculator to compute
max-duration bounds. Prefer get_lane_address(src, dst) for
single-pair lookups.
Returns
Iterator[LaneAddress]
propertyzones¶source
bloqade.lanes.arch.spec.ArchSpec.zones
zones: tuple[_RustZone, ...]propertymodes¶source
bloqade.lanes.arch.spec.ArchSpec.modes
modes: tuple[_RustMode, ...]methodis_home_position¶source
bloqade.lanes.arch.spec.ArchSpec.is_home_position
def is_home_position(addr: LocationAddress) -> boolTrue if this address is at a home (non-CZ-staging) word.
Parameters
| Name | Type | Description |
|---|---|---|
addr | LocationAddress |
Returns
bool
propertyword_zone_map¶source
bloqade.lanes.arch.spec.ArchSpec.word_zone_map
word_zone_map: dict[int, int]Map each word_id to the zone_id it belongs to.
Delegates to Rust ArchSpec.word_zone_map().
propertyhome_sites¶source
bloqade.lanes.arch.spec.ArchSpec.home_sites
home_sites: frozenset[LocationAddress]All home LocationAddresses with correct zone_id per word.
A home site is (zone_id, word_id, site_id) where word_id is
a home word (lower word_id in each entangling pair, or unpaired)
and zone_id is the zone that word belongs to.
propertycz_zone_addresses¶source
bloqade.lanes.arch.spec.ArchSpec.cz_zone_addresses
cz_zone_addresses: frozenset[ZoneAddress]Zones that host CZ entangling operations (have entangling_pairs).
sourcepropertyfeed_forward¶source
bloqade.lanes.arch.spec.ArchSpec.feed_forward
feed_forward: boolWhether the device supports mid-circuit measurement with classical feedback.
sourcepropertyatom_reloading¶source
bloqade.lanes.arch.spec.ArchSpec.atom_reloading
propertyblockade_radius¶source
bloqade.lanes.arch.spec.ArchSpec.blockade_radius
blockade_radius: float | NoneRydberg blockade radius (µm), or None if not provided.
This is metadata — when present, it indicates the radius associated with the architecture and is typically used to interpret the entangling pairs. It is not independently verified at the ArchSpec level; use ZoneBuilder.set_blockade_radius / ArchBuilder.set_blockade_radius if you want the pair list to be derived from and checked against a radius.
sourcepropertysite_buses¶source
bloqade.lanes.arch.spec.ArchSpec.site_buses
site_buses: tuple[SiteBus, ...]Aggregate all site buses across all zones.
Note: indices in this flat list do NOT correspond to per-zone
bus_id values in LaneAddress. Prefer iterating zones directly
via self.zones[i].site_buses.
propertyword_buses¶source
bloqade.lanes.arch.spec.ArchSpec.word_buses
word_buses: tuple[WordBus, ...]Aggregate all word buses across all zones.
Note: indices in this flat list do NOT correspond to per-zone
bus_id values in LaneAddress. Prefer iterating zones directly
via self.zones[i].word_buses.
propertyzone_buses¶source
bloqade.lanes.arch.spec.ArchSpec.zone_buses
zone_buses: tuple[ZoneBus, ...]methodfrom_components¶source
bloqade.lanes.arch.spec.ArchSpec.from_components
Signature
def from_components(words: tuple[Word, ...], zones: tuple[_RustZone, ...], modes: Sequence[_RustMode], zone_buses: Sequence[ZoneBus] = (), paths: dict[LaneAddress, tuple[tuple[float, float], ...]] | None = None, feed_forward: bool = False, atom_reloading: bool = False, blockade_radius: float | None = None) -> ArchSpecConstruct an ArchSpec from Python component types.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
words | tuple[Word, ...] | required | |
zones | tuple[_RustZone, ...] | required | |
modes | Sequence[_RustMode] | required | |
zone_buses | Sequence[ZoneBus] | () | |
paths | dict[LaneAddress, tuple[tuple[float, float], ...]] | None | None | |
feed_forward | bool | False | |
atom_reloading | bool | False | |
blockade_radius | float | None | None |
Returns
ArchSpec
methodto_json¶source
bloqade.lanes.arch.spec.ArchSpec.to_json
propertysites_per_word¶source
bloqade.lanes.arch.spec.ArchSpec.sites_per_word
propertymax_qubits¶source
bloqade.lanes.arch.spec.ArchSpec.max_qubits
methodyield_zone_locations¶source
bloqade.lanes.arch.spec.ArchSpec.yield_zone_locations
Signature
def yield_zone_locations(zone_address: ZoneAddress) -> Iterator[LocationAddress]Yield LocationAddresses in the canonical zone-bitstring iteration order.
This is the layout that get_zone_index(loc, zone_address)
numbers: every (word, site) pair in the architecture, tagged
with zone_address, walked in word-major then site-major order.
The iterator visits every word — zone_address is the tag
stamped onto each yielded address (and the grid through which
downstream calls like get_position interpret it), not a
membership filter.
Parameters
| Name | Type | Description |
|---|---|---|
zone_address | ZoneAddress |
Returns
Iterator[LocationAddress]
methodget_zone_index¶source
bloqade.lanes.arch.spec.ArchSpec.get_zone_index
Signature
def get_zone_index(loc_addr: LocationAddress, zone_id: ZoneAddress) -> int | NoneO(1) flat index of a location within a zone.
Delegates to Rust ArchSpec.zone_location_index().
Parameters
| Name | Type | Description |
|---|---|---|
loc_addr | LocationAddress | |
zone_id | ZoneAddress |
Returns
int | None
methodget_path¶source
bloqade.lanes.arch.spec.ArchSpec.get_path
Signature
def get_path(lane_address: LaneAddress) -> tuple[tuple[float, float], ...]Parameters
| Name | Type | Description |
|---|---|---|
lane_address | LaneAddress |
Returns
tuple[tuple[float, float], ...]
methodget_position¶source
bloqade.lanes.arch.spec.ArchSpec.get_position
def get_position(location: LocationAddress) -> tuple[float, float]Parameters
| Name | Type | Description |
|---|---|---|
location | LocationAddress |
Returns
tuple[float, float]
methodtry_get_position¶source
bloqade.lanes.arch.spec.ArchSpec.try_get_position
Signature
def try_get_position(location: LocationAddress) -> tuple[float, float] | NoneResolve location to its physical (x, y) position, or
None when location doesn’t correspond to a valid site
under the zone its zone_id selects (matches the Rust
location_position contract).
Parameters
| Name | Type | Description |
|---|---|---|
location | LocationAddress |
Returns
tuple[float, float] | None
methodcheck_location_group¶source
bloqade.lanes.arch.spec.ArchSpec.check_location_group
Signature
def check_location_group(locations: Sequence[LocationAddress]) -> Sequence[LocationGroupError]Validate a group of location addresses via Rust.
Returns a list of LocationGroupError exceptions (empty if all valid).
Parameters
| Name | Type | Description |
|---|---|---|
locations | Sequence[LocationAddress] |
Returns
Sequence[LocationGroupError]
methodcheck_lane_group¶source
bloqade.lanes.arch.spec.ArchSpec.check_lane_group
Signature
def check_lane_group(lanes: Sequence[LaneAddress]) -> Sequence[LaneGroupError]Validate a group of lane addresses via Rust.
Checks individual lane validity, group consistency (direction, bus_id, move_type), bus membership, and AOD geometry constraints. Returns a list of LaneGroupError exceptions (empty if all valid).
Parameters
| Name | Type | Description |
|---|---|---|
lanes | Sequence[LaneAddress] |
Returns
Sequence[LaneGroupError]
methodget_lane_address¶source
bloqade.lanes.arch.spec.ArchSpec.get_lane_address
Signature
def get_lane_address(src: LocationAddress, dst: LocationAddress) -> LaneAddress | NoneGiven an input tuple of locations, gets the lane (w/direction).
Delegates to Rust ArchSpec.lane_for_endpoints().
Parameters
| Name | Type | Description |
|---|---|---|
src | LocationAddress | |
dst | LocationAddress |
Returns
LaneAddress | None
methodget_endpoints¶source
bloqade.lanes.arch.spec.ArchSpec.get_endpoints
Signature
def get_endpoints(lane_address: LaneAddress) -> tuple[LocationAddress, LocationAddress]Parameters
| Name | Type | Description |
|---|---|---|
lane_address | LaneAddress |
Returns
tuple[LocationAddress, LocationAddress]
methodtry_get_endpoints¶source
bloqade.lanes.arch.spec.ArchSpec.try_get_endpoints
Signature
def try_get_endpoints(lane_address: LaneAddress) -> tuple[LocationAddress, LocationAddress] | NoneResolve lane_address to its (src, dst) location pair, or
None when the lane is not a valid lane in the architecture
(matches the Rust lane_endpoints contract).
Parameters
| Name | Type | Description |
|---|---|---|
lane_address | LaneAddress |
Returns
tuple[LocationAddress, LocationAddress] | None
methodget_cz_partner¶source
bloqade.lanes.arch.spec.ArchSpec.get_cz_partner
def get_cz_partner(location: LocationAddress) -> LocationAddress | NoneGet the CZ partner for a given location.
Uses Rust-side get_cz_partner which resolves via the zone’s entangling_pairs.
Parameters
| Name | Type | Description |
|---|---|---|
location | LocationAddress |
Returns
LocationAddress | None
methodlocation_at¶source
bloqade.lanes.arch.spec.ArchSpec.location_at
def location_at(zone: int, row: int, col: int) -> LocationAddress | NoneResolve a (zone, row, col) grid coordinate to a LocationAddress.
col is the grid x-index and row the grid y-index within zone.
Returns the location whose word site sits at that grid position (a
unique (word_id, site_id) within the zone), or None if no atom
occupies it. This is the authoritative (row, col) -> location
mapping for the architecture’s addressing scheme (defined Rust-side);
callers depend only on this, not on the word/site layout.
Parameters
| Name | Type | Description |
|---|---|---|
zone | int | |
row | int | |
col | int |
Returns
LocationAddress | None