bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy
classPhysicalPlacementStrategy¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
arch_spec | ArchSpec | get_physical_arch_spec() | |
traversal | RustPlacementTraversal | (lambda: RustPlacementTraversal(strategy='entropy'))() | |
target_generator | TargetGeneratorABC | TargetGeneratorCallable | None | None |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
arch_spec | ArchSpec | field(default_factory=get_physical_arch_spec) | |
traversal | RustPlacementTraversal | field(default_factory=(lambda: RustPlacementTraversal(strategy='entropy'))) | |
target_generator | TargetGeneratorABC | TargetGeneratorCallable | None | None |
propertytrace_cz_index¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.trace_cz_index
trace_cz_index: int | Nonemethodvalidate_initial_layout¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.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.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, ...]], ...] = ()) -> 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
propertyrust_nodes_expanded_total¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.rust_nodes_expanded_total
propertyrust_bound_stats_total¶source
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.
propertyrust_entropy_fallback_count¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.rust_entropy_fallback_count
rust_entropy_fallback_count: intNumber 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).
sourcepropertytraced_rust_entropy_trace¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.traced_rust_entropy_trace
traced_rust_entropy_trace: EntropyTrace | Nonepropertytraced_target¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.traced_target
traced_target: dict[int, LocationAddress]First candidate target for the traced CZ layer (used by visualizers).
sourcepropertytraced_blocked_locations¶source
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).
sourcemethodsq_placements¶source
bloqade.lanes.heuristics.physical.movement.PhysicalPlacementStrategy.sq_placements
Signature
def sq_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomStateParameters
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] |
Returns
AtomState
methodcompute_moves¶source
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
| Name | Type | Description |
|---|---|---|
state_before | ConcreteState | |
state_after | ConcreteState |
Returns
tuple[tuple[LaneAddress, ...], ...]