bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses
classResolvePinnedAddresses¶source
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
| Name | Type | Description |
|---|---|---|
address_entries | dict[ir.SSAValue, address.Address] | |
initial_layout | tuple[LocationAddress, ...] |
Attributes
| Name | Type | Description |
|---|---|---|
address_entries | dict[ir.SSAValue, address.Address] | |
initial_layout | tuple[LocationAddress, ...] |
methodrewrite_Statement¶source
bloqade.lanes.rewrite.resolve_pinned.ResolvePinnedAddresses.rewrite_Statement
def rewrite_Statement(node: ir.Statement) -> abc.RewriteResultParameters
| Name | Type | Description |
|---|---|---|
node | ir.Statement |
Returns
abc.RewriteResult