bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC
classPlacementStrategyABC¶source
bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC
Bases: abc.ABC
class PlacementStrategyABC(arch_spec: ArchSpec)Parameters
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
Attributes
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
methodvalidate_initial_layout¶source
bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.validate_initial_layout
Signature
def validate_initial_layout(initial_layout: tuple[LocationAddress, ...]) -> NoneParameters
| Name | Type | Description |
|---|---|---|
initial_layout | tuple[LocationAddress, ...] |
methodcz_placements¶source
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, ...]], ...] = ()) -> AtomStateParameters
| Name | Type | Default | Description |
|---|---|---|---|
state | AtomState | required | |
controls | tuple[int, ...] | required | |
targets | tuple[int, ...] | required | |
lookahead_cz_layers | tuple[tuple[tuple[int, ...], tuple[int, ...]], ...] | () |
Returns
AtomState
methodsq_placements¶source
bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.sq_placements
Signature
def sq_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomStateParameters
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] |
Returns
AtomState
methodmeasure_placements¶source
bloqade.lanes.analysis.placement.strategy.PlacementStrategyABC.measure_placements
Signature
def measure_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomStatePlace 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
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] |
Returns
AtomState