Logical layout
LogicalLayoutHeuristic
dataclass
LogicalLayoutHeuristic()
Bases: LayoutHeuristicABC
compute_layout
compute_layout(
all_qubits: tuple[int, ...],
stages: list[tuple[tuple[int, int], ...]],
) -> tuple[layout.LocationAddress, ...]
Compute the initial qubit layout from circuit stages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_qubits
|
tuple[int, ...]
|
Tuple of logical qubit indices to be mapped. |
required |
stages
|
list[tuple[tuple[int, int], ...]]
|
List of circuit stages, where each stage is a tuple of (control, target) qubit pairs representing two-qubit gates. For example: [ ((control1, target1), (control2, target2)), # stage 1 ((control3, target3),), # stage 2 ... ] |
required |
Returns:
| Type | Description |
|---|---|
tuple[LocationAddress, ...]
|
A tuple of LocationAddress objects mapping logical qubit indices to physical locations. |
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/heuristics/logical_layout.py
84 85 86 87 88 89 90 91 92 93 94 95 96 | |
LogicalLayoutHeuristicRecencyWeighted
dataclass
LogicalLayoutHeuristicRecencyWeighted(
layout_lookahead_layers: int | None = None,
layout_decay_gamma: float = 0.85,
)
Bases: LogicalLayoutHeuristic
compute_layout
compute_layout(
all_qubits: tuple[int, ...],
stages: list[tuple[tuple[int, int], ...]],
) -> tuple[layout.LocationAddress, ...]
Compute the initial qubit layout from circuit stages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_qubits
|
tuple[int, ...]
|
Tuple of logical qubit indices to be mapped. |
required |
stages
|
list[tuple[tuple[int, int], ...]]
|
List of circuit stages, where each stage is a tuple of (control, target) qubit pairs representing two-qubit gates. For example: [ ((control1, target1), (control2, target2)), # stage 1 ((control3, target3),), # stage 2 ... ] |
required |
Returns:
| Type | Description |
|---|---|
tuple[LocationAddress, ...]
|
A tuple of LocationAddress objects mapping logical qubit indices to physical locations. |
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/heuristics/logical_layout.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |