Skip to content

Arch

grid_from_rust

grid_from_rust(g: Grid) -> geometry_grid.Grid

Convert a Rust bytecode Grid to a bloqade-geometry Grid.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/arch.py
16
17
18
19
20
21
22
23
def grid_from_rust(g: Grid) -> geometry_grid.Grid:
    """Convert a Rust bytecode Grid to a bloqade-geometry Grid."""
    return geometry_grid.Grid(
        x_init=g.x_start,
        y_init=g.y_start,
        x_spacing=list(g.x_spacing),  # type: ignore[arg-type]
        y_spacing=list(g.y_spacing),  # type: ignore[arg-type]
    )

grid_to_rust

grid_to_rust(g: Grid) -> Grid

Convert a bloqade-geometry Grid to a Rust bytecode Grid.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/bytecode/arch.py
 6
 7
 8
 9
10
11
12
13
def grid_to_rust(g: geometry_grid.Grid) -> Grid:
    """Convert a bloqade-geometry Grid to a Rust bytecode Grid."""
    return Grid(
        x_start=g.x_init,  # type: ignore[arg-type]
        y_start=g.y_init,  # type: ignore[arg-type]
        x_spacing=list(g.x_spacing),
        y_spacing=list(g.y_spacing),
    )