Skip to content

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy

← Module overview

classPolicyPlacementStrategysource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy

Bases: PlacementStrategyABC

Physical placement strategy backed by a Starlark Move Policy DSL.

Signature
class PolicyPlacementStrategy(arch_spec: ArchSpec = get_physical_arch_spec(), target_generator: TargetGeneratorABC | TargetGeneratorCallable | None = None, *, traversal: PolicyTraversal)

Each CZ-stage move synthesis call is dispatched through bloqade.lanes.bytecode._native.PolicyRunner and the policy file named by traversal.policy_path. Target generation reuses the same target_generator / default-fallback pipeline as PhysicalPlacementStrategy.

traversal is keyword-only so it can be required without colliding with the defaulted fields PlacementStrategyABC inherits.

Parameters

NameTypeDefaultDescription
arch_specArchSpecget_physical_arch_spec()
target_generatorTargetGeneratorABC | TargetGeneratorCallable | NoneNone
traversalPolicyTraversalrequired

Attributes

NameTypeDefaultDescription
traversalPolicyTraversalfield(kw_only=True)
arch_specArchSpecfield(default_factory=get_physical_arch_spec)
target_generatorTargetGeneratorABC | TargetGeneratorCallable | NoneNone

methodvalidate_initial_layoutsource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.validate_initial_layout

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

Parameters

NameTypeDescription
initial_layouttuple[LocationAddress, ...]
source

propertyrust_nodes_expanded_totalsource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.rust_nodes_expanded_total

rust_nodes_expanded_total: int

Total Rust DSL kernel node expansions for this strategy instance.

source

methodcz_placementssource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.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

methodsq_placementssource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.sq_placements

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

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]

Returns

AtomState

source

methodmeasure_placementssource

bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.measure_placements

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

Parameters

NameTypeDescription
stateAtomState
qubitstuple[int, ...]

Returns

AtomState

source