bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC
classMoveToPlacementStrategyABC¶source
bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC
Bases: PlacementStrategyABC
Base class for strategies that support user-directed ``MoveTo``.
class MoveToPlacementStrategyABCAdds 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_moves¶source
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
| Name | Type | Description |
|---|---|---|
state_before | ConcreteState | |
state_after | ConcreteState |
Returns
tuple[tuple[LaneAddress, ...], ...]
methodmove_to_placements¶source
bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC.move_to_placements
Signature
def move_to_placements(state: AtomState, qubits: tuple[int, ...], locations: tuple[LocationAddress, ...]) -> AtomStatePlace 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
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] | |
locations | tuple[LocationAddress, ...] |
Returns
AtomState
methodpermute_placements¶source
bloqade.lanes.analysis.placement.strategy.MoveToPlacementStrategyABC.permute_placements
Signature
def permute_placements(state: AtomState, qubits: tuple[int, ...], permutation: tuple[int, ...], insert_moves: bool = False) -> AtomStatePermute 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
| Name | Type | Default | Description |
|---|---|---|---|
state | AtomState | required | |
qubits | tuple[int, ...] | required | |
permutation | tuple[int, ...] | required | |
insert_moves | bool | False |
Returns
AtomState