Skip to content

bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC

← Module overview

classMoveToPlacementStrategyABCsource

bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC

Bases: PlacementStrategyABC

Base class for strategies that support user-directed ``MoveTo``.

class MoveToPlacementStrategyABC

Adds the compute_moves primitive (route atoms between two layouts) and a shared move_to_placements built on top of it. Strategies that do not support user-directed movement should extend PlacementStrategyABC directly; the MoveTo placement interpreter returns bottom for any strategy that is not a MoveToPlacementStrategyABC.

methodcompute_movessource

bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC.compute_moves

Signature
def compute_moves(state_before: ConcreteState, state_after: ConcreteState) -> tuple[tuple[LaneAddress, ...], ...]

Compute the AOD move layers routing atoms from state_before to state_after.

Parameters

NameTypeDescription
state_beforeConcreteState
state_afterConcreteState

Returns

tuple[tuple[LaneAddress, ...], ...]

source

methodmove_to_placementssource

bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC.move_to_placements

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

Place qubits at locations (user-directed movement).

Produces a UserMoved state whose accumulated_move_layers grows across consecutive MoveTo calls within an inter-CZ segment and whose pre_user_layout pins the segment’s home position for the eventual palindrome return.

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]
locationstuple[LocationAddress, ...]

Returns

AtomState

source

methodpermute_placementssource

bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC.permute_placements

Signature
def permute_placements(state: AtomState, qubits: tuple[int, ...], permutation: tuple[int, ...], insert_moves: bool = False) -> AtomState

Permute qubits — a logical relabel where qubits[i] ends up referring to what was qubits[permutation[i]].

insert_moves=False (default) is a lazy relabel: no atoms move, the layout is permuted so each qubit id points at the location of the atom it now denotes, and the quantum information is permuted for free (a later transversal move absorbs the physical permutation). Produces a plain ConcreteState with the permuted layout.

insert_moves=True additionally commits the physical moves that route the atoms so the permutation is realized now, pinning the layout back to the pre-permute layout (each qid keeps its slot, now holding the routed atom). Produces a Permuted state. This is only valid under a non-palindrome strategy (PalindromePlacementStrategy rejects it).

Parameters

NameTypeDefaultDescription
stateAtomStaterequired
qubitstuple[int, ...]required
permutationtuple[int, ...]required
insert_movesboolFalse

Returns

AtomState

source