Word factory
Word creation helpers for zone-based architectures.
Creates row-words arranged in a 2D grid. CZ pairing between horizontally adjacent words is defined at the zone level via entangling_pairs, not per-word.
Words now contain grid index pairs (x_idx, y_idx). Physical positions are resolved via the zone's Grid at the ArchSpec level. Each word has unique grid indices that map to distinct positions within the zone grid.
WordGrid
dataclass
WordGrid(
words: tuple[Word, ...],
num_rows: int,
num_cols: int,
word_id_offset: int,
)
2D grid of words within a zone, preserving row/col structure.
all_word_ids
property
all_word_ids: range
All word IDs in this grid (contiguous range).
cz_pairs
cz_pairs() -> Iterator[tuple[int, int]]
Yield (word_id_a, word_id_b) for all CZ entangling pairs.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/arch/build/word_factory.py
47 48 49 50 51 | |
word_at
word_at(row: int, col: int) -> Word
Get the word at a given grid position.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/arch/build/word_factory.py
34 35 36 | |
word_id_at
word_id_at(row: int, col: int) -> int
Get the global word ID at a given grid position.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/arch/build/word_factory.py
38 39 40 | |
create_zone_words
create_zone_words(
zone_spec: ZoneSpec,
layout: DeviceLayout,
x_offset: float = 0.0,
y_offset: float = 0.0,
word_id_offset: int = 0,
) -> WordGrid
Create all words for a zone in a 2D grid layout.
Each word's sites are represented as grid index pairs (x_idx, y_idx). For interleaved CZ pairs: - Even-column words: sites at x_idx = 0, 2, 4, ... (in the full grid) - Odd-column words: sites at x_idx = 1, 3, 5, ...
Words in different rows use different y_idx values.
Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/arch/build/word_factory.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |