Skip to content

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC

← Module overview

classPlacementStrategyABCsource

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC

Bases: abc.ABC

class PlacementStrategyABC(arch_spec: ArchSpec)

Parameters

NameTypeDescription
arch_specArchSpec

Attributes

NameTypeDescription
arch_specArchSpec

methodvalidate_initial_layoutsource

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.validate_initial_layout

Signature
def validate_initial_layout(initial_layout: tuple[LocationAddress, ...]) -> None

Parameters

NameTypeDescription
initial_layouttuple[LocationAddress, ...]
source

methodcz_placementssource

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.cz_placements

Signature
def cz_placements(state: AtomState, controls: tuple[int, ...], targets: tuple[int, ...], lookahead_cz_layers: tuple[tuple[tuple[int, ...], tuple[int, ...]], ...] = ()) -> AtomState

Parameters

NameTypeDefaultDescription
stateAtomStaterequired
controlstuple[int, ...]required
targetstuple[int, ...]required
lookahead_cz_layerstuple[tuple[tuple[int, ...], tuple[int, ...]], ...]()

Returns

AtomState

source

methodsq_placementssource

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.sq_placements

Signature
def sq_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomState

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]

Returns

AtomState

source

methodmeasure_placementssource

bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.measure_placements

Signature
def measure_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomState

Place a terminal measurement of all qubits.

layout stays canonical (indexed by qubit id) — it must not be permuted, since reordering it would relabel qubits. The measurement order is carried by place.EndMeasure.qubits and applied when the measurement is lowered (see place2move.InsertMeasure), which indexes this canonical layout by qubits so each result reads the location of the qubit it measures (qubits is a permutation once StaticPlacement blocks are merged).

A UserMoved state is accepted here: a user-directed move that ends at a measurement is committed — the atoms stay at their moved layout and are measured there, and the compiler tracks the final positions within the single zone. UserMoved is a ConcreteState subclass, so it flows through the concrete-state path below. PalindromePlacementStrategy overrides this to reject UserMoved instead: under palindrome a user-move is only committed by a following CZ, never a measurement.

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]

Returns

AtomState

source