def ramp(s, width, annealing_time):
    """Schedule with a ramp shape.

    Args:
        s (float):
            The mid-point of the ramp, as a fraction of the annealing time.

        width (float):
            The width of the ramp, as a fraction of the annealing time. Note
            that QPUs have a maximum slope.

        annealing_time (float):
            The total annealing time, in microseconds.

    Returns:
        list[2-tuple]: The points defining in a piece-wise curve in the shape of
        a ramp.

    Examples:
        This example constructs a schedule for a QPU that supports
        configuring an `h_gain_schedule`.

        >>> sampler = DWaveSampler(solver=dict(annealing_time=True,
                                               h_gain_schedule=True))
        >>> h = {v: -1 for v in sampler.nodelist}
        >>> schedule = ramp(.5, .2, sampler.properties['default_annealing_time'])
        >>> sampleset = sampler.sample_ising(h, {}, h_gain_schedule=schedule)

    """
    if s <= 0 or s >= 1:
        raise ValueError("s should be in interval (0, 1)")
    if width >= min(s, 1 - s) / 2:
        raise ValueError("given width takes curve outside of [0, 1] interval")

    return [(0, 0),
            (annealing_time * (s - width / 2), 0),
            (annealing_time * (s + width / 2), 1),
            (annealing_time, 1)]