Skip to content

Device Settings

DeviceSettings

Bases: ABC

Device settings to ease the building of sequence, register and interface logic

name (str): the name of the device, ex: Analog Device name_short (str): a shorter name version, ex: analog device (pulser.devices.Device): the pulser device grid_scale_range (tuple[float, float]): a tuple of min and max values for the grid scale, ex: (1.0, 1.0) (should not scale), (1.0, 10.0) (up to 10.0, included) available_grid_types (tuple[str]): a tuple of all the possible grid types for the device, ex: ("triangular",), ("linear", "square") available_directives (tuple[str], optional): a tuple of available directives, ex: ("enable_digital_analog")

scale_in_range(grid_scale)

Check whether the grid scale is within device's range.

PARAMETER DESCRIPTION
grid_scale

the grid scale. For a normal grid, the scale is 1.0

TYPE: float

RETURNS DESCRIPTION
bool

A boolean to whether the grid scale is within device's range.

Source code in qadence2_platforms/backends/_base_analog/device_settings.py
def scale_in_range(self, grid_scale: float) -> bool:
    """
    Check whether the grid scale is within device's range.

    Args:
        grid_scale (float): the grid scale. For a normal grid, the scale is 1.0

    Returns:
        A boolean to whether the grid scale is within device's range.
    """

    return self._grid_scale_range[0] <= grid_scale <= self._grid_scale_range[1]