Skip to content

Spec

single_zone_spec

single_zone_spec(
    num_x: int, num_y: int, spacing: float = 10.0
) -> spec.ArchSpec

Create a static trap spec with a single zone. compatible with the stdlib

Parameters:

Name Type Description Default
num_x int

Number of traps in the x direction.

required
num_y int

Number of traps in the y direction.

required
spacing float

Spacing between traps in both directions. Default is 10.0.

10.0

Returns:

Type Description
ArchSpec

spec.Spec: A specification object containing the layout with a single zone.

Source code in src/bloqade/shuttle/stdlib/spec.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def single_zone_spec(num_x: int, num_y: int, spacing: float = 10.0) -> spec.ArchSpec:
    """Create a static trap spec with a single zone. compatible with the stdlib

    Args:
        num_x (int): Number of traps in the x direction.
        num_y (int): Number of traps in the y direction.
        spacing (float): Spacing between traps in both directions. Default is 10.0.

    Returns:
        spec.Spec: A specification object containing the layout with a single zone.

    """
    x_spacing = tuple(repeat(spacing, num_x - 1))
    y_spacing = tuple(repeat(spacing, num_y - 1))

    return spec.ArchSpec(
        layout=spec.Layout(
            static_traps={"traps": grid.Grid(x_spacing, y_spacing, 0.0, 0.0)},
            fillable=set(["traps"]),
        )
    )