Skip to content

Resolve pinned

ResolvePinnedAddresses dataclass

ResolvePinnedAddresses(
    address_entries: dict[SSAValue, Address],
    initial_layout: tuple[LocationAddress, ...],
)

Bases: RewriteRule


              flowchart TD
              bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses[ResolvePinnedAddresses]

              

              click bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses href "" "bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses"
            

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

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.