Skip to content

bloqade.lanes.arch.spec.ArchSpec

← Module overview

classArchSpecsource

bloqade.lanes.arch.spec.ArchSpec

Bases: RustWrapper[_RustArchSpec]

Architecture specification for a quantum device.

class ArchSpec(inner: _RustArchSpec)

Parameters

NameTypeDescription
inner_RustArchSpec

propertywordssource

bloqade.lanes.arch.spec.ArchSpec.words

words: tuple[Word, ...]

Python Word wrappers, derived from the Rust ArchSpec.

source

propertypathssource

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.

source

methoditer_all_lanessource

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]

source

propertyzonessource

bloqade.lanes.arch.spec.ArchSpec.zones

zones: tuple[_RustZone, ...]
source

propertymodessource

bloqade.lanes.arch.spec.ArchSpec.modes

modes: tuple[_RustMode, ...]
source

methodis_home_positionsource

bloqade.lanes.arch.spec.ArchSpec.is_home_position

def is_home_position(addr: LocationAddress) -> bool

True if this address is at a home (non-CZ-staging) word.

Parameters

NameTypeDescription
addrLocationAddress

Returns

bool

source

propertyword_zone_mapsource

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().

source

propertyhome_sitessource

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.

source

propertycz_zone_addressessource

bloqade.lanes.arch.spec.ArchSpec.cz_zone_addresses

cz_zone_addresses: frozenset[ZoneAddress]

Zones that host CZ entangling operations (have entangling_pairs).

source

propertyfeed_forwardsource

bloqade.lanes.arch.spec.ArchSpec.feed_forward

feed_forward: bool

Whether the device supports mid-circuit measurement with classical feedback.

source

propertyatom_reloadingsource

bloqade.lanes.arch.spec.ArchSpec.atom_reloading

atom_reloading: bool

Whether the device supports reloading atoms after initial fill.

source

propertyblockade_radiussource

bloqade.lanes.arch.spec.ArchSpec.blockade_radius

blockade_radius: float | None

Rydberg 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.

source

propertysite_busessource

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.

source

propertyword_busessource

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.

source

propertyzone_busessource

bloqade.lanes.arch.spec.ArchSpec.zone_buses

zone_buses: tuple[ZoneBus, ...]
source

methodfrom_componentssource

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) -> ArchSpec

Construct an ArchSpec from Python component types.

Parameters

NameTypeDefaultDescription
wordstuple[Word, ...]required
zonestuple[_RustZone, ...]required
modesSequence[_RustMode]required
zone_busesSequence[ZoneBus]()
pathsdict[LaneAddress, tuple[tuple[float, float], ...]] | NoneNone
feed_forwardboolFalse
atom_reloadingboolFalse
blockade_radiusfloat | NoneNone

Returns

ArchSpec

source

methodto_jsonsource

bloqade.lanes.arch.spec.ArchSpec.to_json

def to_json() -> str

Serialize this architecture spec to a JSON string.

Returns

str

source

propertysites_per_wordsource

bloqade.lanes.arch.spec.ArchSpec.sites_per_word

sites_per_word: int

Get the number of sites per word.

source

propertymax_qubitssource

bloqade.lanes.arch.spec.ArchSpec.max_qubits

max_qubits: int

Get the maximum number of qubits supported by this architecture.

source

methodyield_zone_locationssource

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

NameTypeDescription
zone_addressZoneAddress

Returns

Iterator[LocationAddress]

source

methodget_zone_indexsource

bloqade.lanes.arch.spec.ArchSpec.get_zone_index

Signature
def get_zone_index(loc_addr: LocationAddress, zone_id: ZoneAddress) -> int | None

O(1) flat index of a location within a zone.

Delegates to Rust ArchSpec.zone_location_index().

Parameters

NameTypeDescription
loc_addrLocationAddress
zone_idZoneAddress

Returns

int | None

source

methodget_pathsource

bloqade.lanes.arch.spec.ArchSpec.get_path

Signature
def get_path(lane_address: LaneAddress) -> tuple[tuple[float, float], ...]

Parameters

NameTypeDescription
lane_addressLaneAddress

Returns

tuple[tuple[float, float], ...]

source

methodget_positionsource

bloqade.lanes.arch.spec.ArchSpec.get_position

def get_position(location: LocationAddress) -> tuple[float, float]

Parameters

NameTypeDescription
locationLocationAddress

Returns

tuple[float, float]

source

methodtry_get_positionsource

bloqade.lanes.arch.spec.ArchSpec.try_get_position

Signature
def try_get_position(location: LocationAddress) -> tuple[float, float] | None

Resolve 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

NameTypeDescription
locationLocationAddress

Returns

tuple[float, float] | None

source

methodcheck_location_groupsource

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

NameTypeDescription
locationsSequence[LocationAddress]

Returns

Sequence[LocationGroupError]

source

methodcheck_lane_groupsource

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

NameTypeDescription
lanesSequence[LaneAddress]

Returns

Sequence[LaneGroupError]

source

methodget_lane_addresssource

bloqade.lanes.arch.spec.ArchSpec.get_lane_address

Signature
def get_lane_address(src: LocationAddress, dst: LocationAddress) -> LaneAddress | None

Given an input tuple of locations, gets the lane (w/direction).

Delegates to Rust ArchSpec.lane_for_endpoints().

Parameters

NameTypeDescription
srcLocationAddress
dstLocationAddress

Returns

LaneAddress | None

source

methodget_endpointssource

bloqade.lanes.arch.spec.ArchSpec.get_endpoints

Signature
def get_endpoints(lane_address: LaneAddress) -> tuple[LocationAddress, LocationAddress]

Parameters

NameTypeDescription
lane_addressLaneAddress

Returns

tuple[LocationAddress, LocationAddress]

source

methodtry_get_endpointssource

bloqade.lanes.arch.spec.ArchSpec.try_get_endpoints

Signature
def try_get_endpoints(lane_address: LaneAddress) -> tuple[LocationAddress, LocationAddress] | None

Resolve 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

NameTypeDescription
lane_addressLaneAddress

Returns

tuple[LocationAddress, LocationAddress] | None

source

methodget_cz_partnersource

bloqade.lanes.arch.spec.ArchSpec.get_cz_partner

def get_cz_partner(location: LocationAddress) -> LocationAddress | None

Get the CZ partner for a given location.

Uses Rust-side get_cz_partner which resolves via the zone’s entangling_pairs.

Parameters

NameTypeDescription
locationLocationAddress

Returns

LocationAddress | None

source

methodlocation_atsource

bloqade.lanes.arch.spec.ArchSpec.location_at

def location_at(zone: int, row: int, col: int) -> LocationAddress | None

Resolve 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

NameTypeDescription
zoneint
rowint
colint

Returns

LocationAddress | None

source