Skip to content

Encoding

LaneAddress

LaneAddress(
    move_type: MoveType,
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
)

Bases: KirinRustWrapper[LaneAddress]


              flowchart TD
              bloqade.lanes.bytecode.encoding.LaneAddress[LaneAddress]
              bloqade.lanes.bytecode._wrapper.KirinRustWrapper[KirinRustWrapper]
              bloqade.lanes.bytecode._wrapper.RustWrapper[RustWrapper]

                              bloqade.lanes.bytecode._wrapper.KirinRustWrapper --> bloqade.lanes.bytecode.encoding.LaneAddress
                                bloqade.lanes.bytecode._wrapper.RustWrapper --> bloqade.lanes.bytecode._wrapper.KirinRustWrapper
                



              click bloqade.lanes.bytecode.encoding.LaneAddress href "" "bloqade.lanes.bytecode.encoding.LaneAddress"
              click bloqade.lanes.bytecode._wrapper.KirinRustWrapper href "" "bloqade.lanes.bytecode._wrapper.KirinRustWrapper"
              click bloqade.lanes.bytecode._wrapper.RustWrapper href "" "bloqade.lanes.bytecode._wrapper.RustWrapper"
            

Address identifying a transport lane.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
def __init__(
    self,
    move_type: MoveType,
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
):
    self._inner = _RustLaneAddress(
        move_type,
        zone_id,
        word_id,
        site_id,
        bus_id,
        direction,
    )
    self.__post_init__()

replace

replace(
    *,
    move_type: MoveType | None = None,
    word_id: int | None = None,
    site_id: int | None = None,
    bus_id: int | None = None,
    direction: Direction | None = None,
    zone_id: int | None = None
) -> Self

Return a copy, optionally replacing fields.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
def replace(
    self,
    *,
    move_type: MoveType | None = None,
    word_id: int | None = None,
    site_id: int | None = None,
    bus_id: int | None = None,
    direction: Direction | None = None,
    zone_id: int | None = None,
) -> Self:
    """Return a copy, optionally replacing fields."""
    return LaneAddress(  # type: ignore[return-value]
        move_type if move_type is not None else self.move_type,
        word_id if word_id is not None else self.word_id,
        site_id if site_id is not None else self.site_id,
        bus_id if bus_id is not None else self.bus_id,
        direction if direction is not None else self.direction,
        zone_id if zone_id is not None else self.zone_id,
    )

src_site

src_site() -> LocationAddress

Get the source site as a LocationAddress.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
132
133
134
def src_site(self) -> LocationAddress:
    """Get the source site as a LocationAddress."""
    return LocationAddress(self.word_id, self.site_id, self.zone_id)

LocationAddress

LocationAddress(
    word_id: int, site_id: int, zone_id: int = 0
)

Bases: KirinRustWrapper[LocationAddress]


              flowchart TD
              bloqade.lanes.bytecode.encoding.LocationAddress[LocationAddress]
              bloqade.lanes.bytecode._wrapper.KirinRustWrapper[KirinRustWrapper]
              bloqade.lanes.bytecode._wrapper.RustWrapper[RustWrapper]

                              bloqade.lanes.bytecode._wrapper.KirinRustWrapper --> bloqade.lanes.bytecode.encoding.LocationAddress
                                bloqade.lanes.bytecode._wrapper.RustWrapper --> bloqade.lanes.bytecode._wrapper.KirinRustWrapper
                



              click bloqade.lanes.bytecode.encoding.LocationAddress href "" "bloqade.lanes.bytecode.encoding.LocationAddress"
              click bloqade.lanes.bytecode._wrapper.KirinRustWrapper href "" "bloqade.lanes.bytecode._wrapper.KirinRustWrapper"
              click bloqade.lanes.bytecode._wrapper.RustWrapper href "" "bloqade.lanes.bytecode._wrapper.RustWrapper"
            

Address identifying a physical atom location (zone + word + site).

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
38
39
40
def __init__(self, word_id: int, site_id: int, zone_id: int = 0):
    self._inner = _RustLocationAddress(zone_id, word_id, site_id)
    self.__post_init__()

replace

replace(
    *,
    word_id: int | None = None,
    site_id: int | None = None,
    zone_id: int | None = None
) -> Self

Return a copy, optionally replacing fields.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
63
64
65
66
67
68
69
70
71
72
73
74
75
def replace(
    self,
    *,
    word_id: int | None = None,
    site_id: int | None = None,
    zone_id: int | None = None,
) -> Self:
    """Return a copy, optionally replacing fields."""
    return LocationAddress(  # type: ignore[return-value]
        word_id if word_id is not None else self.word_id,
        site_id if site_id is not None else self.site_id,
        zone_id if zone_id is not None else self.zone_id,
    )

SiteLaneAddress

SiteLaneAddress(
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
)

Bases: LaneAddress


              flowchart TD
              bloqade.lanes.bytecode.encoding.SiteLaneAddress[SiteLaneAddress]
              bloqade.lanes.bytecode.encoding.LaneAddress[LaneAddress]
              bloqade.lanes.bytecode._wrapper.KirinRustWrapper[KirinRustWrapper]
              bloqade.lanes.bytecode._wrapper.RustWrapper[RustWrapper]

                              bloqade.lanes.bytecode.encoding.LaneAddress --> bloqade.lanes.bytecode.encoding.SiteLaneAddress
                                bloqade.lanes.bytecode._wrapper.KirinRustWrapper --> bloqade.lanes.bytecode.encoding.LaneAddress
                                bloqade.lanes.bytecode._wrapper.RustWrapper --> bloqade.lanes.bytecode._wrapper.KirinRustWrapper
                




              click bloqade.lanes.bytecode.encoding.SiteLaneAddress href "" "bloqade.lanes.bytecode.encoding.SiteLaneAddress"
              click bloqade.lanes.bytecode.encoding.LaneAddress href "" "bloqade.lanes.bytecode.encoding.LaneAddress"
              click bloqade.lanes.bytecode._wrapper.KirinRustWrapper href "" "bloqade.lanes.bytecode._wrapper.KirinRustWrapper"
              click bloqade.lanes.bytecode._wrapper.RustWrapper href "" "bloqade.lanes.bytecode._wrapper.RustWrapper"
            

LaneAddress with move_type fixed to MoveType.SITE.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
160
161
162
163
164
165
166
167
168
def __init__(
    self,
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
):
    super().__init__(MoveType.SITE, word_id, site_id, bus_id, direction, zone_id)

WordLaneAddress

WordLaneAddress(
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
)

Bases: LaneAddress


              flowchart TD
              bloqade.lanes.bytecode.encoding.WordLaneAddress[WordLaneAddress]
              bloqade.lanes.bytecode.encoding.LaneAddress[LaneAddress]
              bloqade.lanes.bytecode._wrapper.KirinRustWrapper[KirinRustWrapper]
              bloqade.lanes.bytecode._wrapper.RustWrapper[RustWrapper]

                              bloqade.lanes.bytecode.encoding.LaneAddress --> bloqade.lanes.bytecode.encoding.WordLaneAddress
                                bloqade.lanes.bytecode._wrapper.KirinRustWrapper --> bloqade.lanes.bytecode.encoding.LaneAddress
                                bloqade.lanes.bytecode._wrapper.RustWrapper --> bloqade.lanes.bytecode._wrapper.KirinRustWrapper
                




              click bloqade.lanes.bytecode.encoding.WordLaneAddress href "" "bloqade.lanes.bytecode.encoding.WordLaneAddress"
              click bloqade.lanes.bytecode.encoding.LaneAddress href "" "bloqade.lanes.bytecode.encoding.LaneAddress"
              click bloqade.lanes.bytecode._wrapper.KirinRustWrapper href "" "bloqade.lanes.bytecode._wrapper.KirinRustWrapper"
              click bloqade.lanes.bytecode._wrapper.RustWrapper href "" "bloqade.lanes.bytecode._wrapper.RustWrapper"
            

LaneAddress with move_type fixed to MoveType.WORD.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
174
175
176
177
178
179
180
181
182
def __init__(
    self,
    word_id: int,
    site_id: int,
    bus_id: int,
    direction: Direction = Direction.FORWARD,
    zone_id: int = 0,
):
    super().__init__(MoveType.WORD, word_id, site_id, bus_id, direction, zone_id)

ZoneAddress

ZoneAddress(zone_id: int)

Bases: KirinRustWrapper[ZoneAddress]


              flowchart TD
              bloqade.lanes.bytecode.encoding.ZoneAddress[ZoneAddress]
              bloqade.lanes.bytecode._wrapper.KirinRustWrapper[KirinRustWrapper]
              bloqade.lanes.bytecode._wrapper.RustWrapper[RustWrapper]

                              bloqade.lanes.bytecode._wrapper.KirinRustWrapper --> bloqade.lanes.bytecode.encoding.ZoneAddress
                                bloqade.lanes.bytecode._wrapper.RustWrapper --> bloqade.lanes.bytecode._wrapper.KirinRustWrapper
                



              click bloqade.lanes.bytecode.encoding.ZoneAddress href "" "bloqade.lanes.bytecode.encoding.ZoneAddress"
              click bloqade.lanes.bytecode._wrapper.KirinRustWrapper href "" "bloqade.lanes.bytecode._wrapper.KirinRustWrapper"
              click bloqade.lanes.bytecode._wrapper.RustWrapper href "" "bloqade.lanes.bytecode._wrapper.RustWrapper"
            

Address identifying a zone in the architecture.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/encoding.py
21
22
23
def __init__(self, zone_id: int):
    self._inner = _RustZoneAddress(zone_id)
    self.__post_init__()