Skip to content

Waypoints

move_by_waypoints

move_by_waypoints(
    waypoints: ilist.IList[
        grid.Grid[NumX, NumY], NumWaypoints
    ],
    pick: bool = True,
    drop: bool = True,
)

Move the tweezer by a list of waypoints.

Parameters:

Name Type Description Default
waypoints IList[Grid[NumX, NumY], NumWaypoints]

The waypoints to move to.

required
pick bool

Whether to pick up the tweezer at the first waypoint. Defaults to True.

True
drop bool

Whether to drop the tweezer at the last waypoint. Defaults to True.

True
Source code in src/bloqade/shuttle/stdlib/waypoints.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@move
def move_by_waypoints(
    waypoints: ilist.IList[grid.Grid[NumX, NumY], NumWaypoints],
    pick: bool = True,
    drop: bool = True,
):
    """Move the tweezer by a list of waypoints.

    Args:
        waypoints (ilist.IList[grid.Grid[NumX, NumY], NumWaypoints]): The waypoints to move to.
        pick (bool): Whether to pick up the tweezer at the first waypoint. Defaults to True.
        drop (bool): Whether to drop the tweezer at the last waypoint. Defaults to True.

    """
    if len(waypoints) < 1:
        return

    shape = grid.shape(waypoints[0])
    device_kernel = schedule.device_fn(
        move_by_waypoints_kernel,
        ilist.range(shape[0]),
        ilist.range(shape[1]),
    )
    device_kernel(waypoints, pick, drop)

move_by_waypoints_kernel

move_by_waypoints_kernel(
    waypoints: ilist.IList[
        grid.Grid[NumX, NumY], NumWaypoints
    ],
    pick: bool,
    drop: bool,
)

Pick up the tweezer at the specified location.

Source code in src/bloqade/shuttle/stdlib/waypoints.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@tweezer
def move_by_waypoints_kernel(
    waypoints: ilist.IList[grid.Grid[NumX, NumY], NumWaypoints],
    pick: bool,
    drop: bool,
):
    """Pick up the tweezer at the specified location."""
    action.set_loc(waypoints[0])
    if pick:
        action.turn_on(action.ALL, action.ALL)

    num_waypoints = len(waypoints)
    for i in range(1, num_waypoints):
        action.move(waypoints[i])

    if drop:
        action.turn_off(action.ALL, action.ALL)