Skip to content

Moves

default_move_cz_impl

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.

Parameters:

Name Type Description Default
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/moves.py
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
@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:
        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)