Upstream
always_merge_heuristic
always_merge_heuristic(
region_a: Region, region_b: Region
) -> bool
Always allow merging; all CZs end up in one region in the Place IR.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/upstream.py
30 31 32 | |
squin_to_move
squin_to_move(
mt: Method,
layout_heuristic: LayoutHeuristicABC,
placement_strategy: PlacementStrategyABC,
insert_return_moves: bool = True,
revert_initial_position: Callable[
[dict[SSAValue, AtomState], StaticPlacement],
tuple[tuple[LaneAddress, ...], ...] | None,
] = place2move.palindrome_move_layers,
merge_heuristic: Callable[
[Region, Region], bool
] = default_merge_heuristic,
no_raise: bool = True,
logical_initialize: bool = True,
) -> ir.Method
Compile a squin kernel to move dialect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mt
|
Method
|
The Squin kernel to compile. |
required |
layout_heuristic
|
LayoutHeuristicABC
|
The layout heuristic to use. |
required |
placement_strategy
|
PlacementStrategyABC
|
The placement strategy to use. |
required |
insert_return_moves
|
bool
|
Whether to insert return moves. Defaults to True. |
True
|
revert_initial_position
|
Callable
|
Callback returning move layers to insert near the end of each static placement region. Defaults to palindrome_move_layers. |
palindrome_move_layers
|
merge_heuristic
|
Callable[[Region, Region], bool]
|
Heuristic for merging placement regions. Defaults to default_merge_heuristic. |
default_merge_heuristic
|
no_raise
|
bool
|
Whether to suppress exceptions during compilation. Defaults to True. |
True
|
logical_initialize
|
bool
|
Whether to apply rewrites that insert logical qubit initialization operations; when False, these rewrites are skipped. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
Method
|
ir.Method: The compiled move dialect method. |
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/upstream.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |