Skip to content

Single col zone

default_move_cz_impl

default_move_cz_impl(
    zone: Grid[Any, Any],
    x_shift: float,
    y_shift: float,
    ctrl_x_ids: IList[int, NumX],
    ctrl_y_ids: IList[int, NumY],
    qarg_x_ids: IList[int, NumX],
    qarg_y_ids: IList[int, NumY],
)

Move atoms from the start ids and run cz gate with the atoms at the end ids.

Parameters:

Name Type Description Default
zone Grid[Any, Any]

The grid representing the trap layout (zone) in which atoms are moved.

required
x_shift float

The amount to shift atoms in the x direction during the move.

required
y_shift float

The amount to shift atoms in the y direction during the move.

required
ctrl_x_ids IList[int, NumX]

The x-indices of the starting positions.

required
ctrl_y_ids IList[int, NumY]

The y-indices of the starting positions.

required
qarg_x_ids IList[int, NumX]

The x-indices of the ending positions.

required
qarg_y_ids IList[int, NumY]

The y-indices of the ending positions.

required
Source code in src/bloqade/shuttle/stdlib/layouts/single_col_zone.py
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
@move
def default_move_cz_impl(
    zone: grid.Grid[Any, Any],
    x_shift: float,
    y_shift: float,
    ctrl_x_ids: ilist.IList[int, NumX],
    ctrl_y_ids: ilist.IList[int, NumY],
    qarg_x_ids: ilist.IList[int, NumX],
    qarg_y_ids: ilist.IList[int, NumY],
):
    """Move atoms from the start ids and run cz gate with the atoms at the end ids.

    Args:
        zone (grid.Grid[Any, Any]): The grid representing the trap layout (zone) in which atoms are moved.
        x_shift (float): The amount to shift atoms in the x direction during the move.
        y_shift (float): The amount to shift atoms in the y direction during the move.
        ctrl_x_ids (ilist.IList[int, NumX]): The x-indices of the starting positions.
        ctrl_y_ids (ilist.IList[int, NumY]): The y-indices of the starting positions.
        qarg_x_ids (ilist.IList[int, NumX]): The x-indices of the ending positions.
        qarg_y_ids (ilist.IList[int, NumY]): The y-indices of the ending positions.
    """
    if len(ctrl_x_ids) < 1 or len(qarg_x_ids) < 1:
        return

    fwd_kernel = schedule.device_fn(
        single_zone_move_cz,
        ilist.range(len(ctrl_x_ids)),
        ilist.range(len(ctrl_y_ids)),
    )
    bwd_kernel = schedule.reverse(fwd_kernel)

    fwd_kernel(zone, ctrl_x_ids, ctrl_y_ids, qarg_x_ids, qarg_y_ids, x_shift, y_shift)
    gate.top_hat_cz(zone)
    bwd_kernel(zone, qarg_x_ids, qarg_y_ids, ctrl_x_ids, ctrl_y_ids, x_shift, y_shift)

get_spec

get_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/layouts/single_col_zone.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def get_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"]),
        )
    )