Skip to content

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy

← Module overview

classPhysicalPlacementStrategysource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy

Bases: MoveToPlacementStrategyABC

Physical placement strategy backed by the Rust ``TargetSolver``.

Signature
class PhysicalPlacementStrategy(arch_spec: ArchSpec = get_physical_arch_spec(), traversal: RustPlacementTraversal = (lambda: RustPlacementTraversal(strategy='entropy'))(), target_generator: TargetGeneratorABC | TargetGeneratorCallable | None = None)

Parameters

NameTypeDefaultDescription
arch_specArchSpecget_physical_arch_spec()
traversalRustPlacementTraversal(lambda: RustPlacementTraversal(strategy='entropy'))()
target_generatorTargetGeneratorABC | TargetGeneratorCallable | NoneNone

Attributes

NameTypeDefaultDescription
arch_specArchSpecfield(default_factory=get_physical_arch_spec)
traversalRustPlacementTraversalfield(default_factory=(lambda: RustPlacementTraversal(strategy='entropy')))
target_generatorTargetGeneratorABC | TargetGeneratorCallable | NoneNone

propertytrace_cz_indexsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.trace_cz_index

trace_cz_index: int | None
source

methodvalidate_initial_layoutsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.validate_initial_layout

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

Parameters

NameTypeDescription
initial_layouttuple[LocationAddress, ...]
source

methodcz_placementssource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.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

propertyrust_nodes_expanded_totalsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.rust_nodes_expanded_total

rust_nodes_expanded_total: int

Total Rust solver node expansions for this strategy instance.

source

propertyrust_bound_stats_totalsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.rust_bound_stats_total

rust_bound_stats_total: dict[str, float]

Branch-and-bound pruning statistics summed over every solve.

Counters and depth sums add; the per-instance root_lower_bound / incumbent_cost / gap do not aggregate meaningfully across solves, so the widest observed gap is kept as max_optimality_gap instead.

Empty — not zeroed — before the first solve, and after any number of solves run with :pyattr:RustPlacementTraversal.completion_bound set to None: an unbounded run measured nothing, and reporting zeros would be indistinguishable from a bounded run that pruned nothing. Key-check rather than expecting the keys to exist.

source

propertyrust_entropy_fallback_countsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.rust_entropy_fallback_count

rust_entropy_fallback_count: int

Number of solved Rust entropy stages that used the budget-exhaustion fallback (Push and Rotate, with the greedy sequential router as the out-of-regime tertiary).

source

propertytraced_rust_entropy_tracesource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.traced_rust_entropy_trace

traced_rust_entropy_trace: EntropyTrace | None
source

propertytraced_targetsource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.traced_target

traced_target: dict[int, LocationAddress]

First candidate target for the traced CZ layer (used by visualizers).

source

propertytraced_blocked_locationssource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.traced_blocked_locations

traced_blocked_locations: tuple[LocationAddress, ...]

Spectator atom positions for the traced CZ layer (atoms not in the active placement).

source

methodsq_placementssource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.sq_placements

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

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]

Returns

AtomState

source

methodcompute_movessource

bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.compute_moves

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

Route atoms between two fixed layouts for user-directed MoveTo.

Delegates to the shared compute_move_layers primitive, passing this strategy’s own traversal and cached SearchEngine so MoveTo routing uses the same search configuration and per-arch lane index as cz_placements (the docstring on compute_move_layers notes the two callsites are meant to share a traversal).

The import is deferred to call time: heuristics.move_synthesis imports this module, so a top-level import would be a cycle.

Parameters

NameTypeDescription
state_beforeConcreteState
state_afterConcreteState

Returns

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

source