Skip to content

Base

RowRegionGateArtist dataclass

RowRegionGateArtist(
    mpl_ax: Any,
    xmin,
    width,
    ymin,
    ymin_keepout,
    ymax,
    ymax_keepout,
    color,
)

Bases: GateArtist

A row region gate artist object.

bound box is [y_origin - width/2, y_origin + width/2]

Source code in .venv/lib/python3.12/site-packages/bloqade/visual/animation/base.py
 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
111
112
113
114
115
116
def __init__(
    self, mpl_ax: Any, xmin, width, ymin, ymin_keepout, ymax, ymax_keepout, color
):
    super().__init__(mpl_ax)
    self.width = width
    self.xmin = xmin
    rc_btm = mpatches.Rectangle(
        (xmin, ymin_keepout),
        width,
        ymin - ymin_keepout,
        color=color,
        alpha=0.3,
        visible=False,
    )
    mpl_ax.add_patch(rc_btm)
    self.mpl_obj_keepout_btm = rc_btm

    rc = mpatches.Rectangle(
        (xmin, ymin), width, ymax - ymin, color=color, alpha=0.6, visible=False
    )
    mpl_ax.add_patch(rc)
    self.mpl_obj = rc

    rc_top = mpatches.Rectangle(
        (xmin, ymax),
        width,
        ymax_keepout - ymax,
        color=color,
        alpha=0.3,
        visible=False,
    )
    mpl_ax.add_patch(rc_top)
    self.mpl_obj_keepout_top = rc_top