Skip to content

bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses

← Module overview

classResolvePinnedAddressessource

bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses

Bases: abc.RewriteRule

Stamp each _NewQubitBase node's location_address from the analysis output.

Signature
class ResolvePinnedAddresses(address_entries: dict[ir.SSAValue, address.Address], initial_layout: tuple[LocationAddress, ...])

Operates on both NewPinnedQubit (physical pipeline) and NewLogicalQubit (logical pipeline) — anything that is a _NewQubitBase subclass.

For nodes that already have a non-None location_address (i.e. user-pinned), the attribute is left alone — the heuristic respected it and the layout entry should match.

For nodes with location_address=None, the heuristic’s choice is looked up via address_entries[stmt.result] -> AddressQubit.data, which indexes into initial_layout.

Post-condition: every _NewQubitBase node has a non-None location_address.

Parameters

NameTypeDescription
address_entriesdict[ir.SSAValue, address.Address]
initial_layouttuple[LocationAddress, ...]

Attributes

NameTypeDescription
address_entriesdict[ir.SSAValue, address.Address]
initial_layouttuple[LocationAddress, ...]

methodrewrite_Statementsource

bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses.rewrite_Statement

def rewrite_Statement(node: ir.Statement) -> abc.RewriteResult

Parameters

NameTypeDescription
nodeir.Statement

Returns

abc.RewriteResult

source