bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy
classPolicyPlacementStrategy¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
arch_spec | ArchSpec | get_physical_arch_spec() | |
target_generator | TargetGeneratorABC | TargetGeneratorCallable | None | None | |
traversal | PolicyTraversal | required |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
traversal | PolicyTraversal | field(kw_only=True) | |
arch_spec | ArchSpec | field(default_factory=get_physical_arch_spec) | |
target_generator | TargetGeneratorABC | TargetGeneratorCallable | None | None |
methodvalidate_initial_layout¶source
bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.validate_initial_layout
Signature
def validate_initial_layout(initial_layout: tuple[LocationAddress, ...]) -> NoneParameters
| Name | Type | Description |
|---|---|---|
initial_layout | tuple[LocationAddress, ...] |
propertyrust_nodes_expanded_total¶source
bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.rust_nodes_expanded_total
rust_nodes_expanded_total: intTotal Rust DSL kernel node expansions for this strategy instance.
sourcemethodcz_placements¶source
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, ...]], ...] = ()) -> 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
methodsq_placements¶source
bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.sq_placements
Signature
def sq_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomStateParameters
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] |
Returns
AtomState
methodmeasure_placements¶source
bloqade.lanes.heuristics.physical.policy_movement.PolicyPlacementStrategy.measure_placements
Signature
def measure_placements(state: AtomState, qubits: tuple[int, ...]) -> AtomStateParameters
| Name | Type | Description |
|---|---|---|
state | AtomState | |
qubits | tuple[int, ...] |
Returns
AtomState