Commit f36ed691 authored by Damien Crielaard's avatar Damien Crielaard
Browse files

Merge branch 'feat/ramp_offset' into 'develop'

Add offset parameter to ramp pulse

See merge request quantify-os/quantify-scheduler!211
parents 1d5cd0a5 fe3a8c08
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ Breaking changes
* The `schedules.timedomain_schedules.allxy_sched` function no longer accepts the string "All" as an argument to the `element_select_idx` keyword.
* The `QuantumDevice.cfg_nr_averages` parameter was renamed to `QuantumDevice.cfg_sched_repetitions`
* The call signature of `gettables.ScheduleVectorAcqGettable` has been renamed to `gettables.ScheduleGettableSingleChannel`, and the call signature has been updated according to #36 to no longer accept several keyword arguments.
* The `RampPulse` has an extra (optional) parameter `offset` (!211)

Merged branches and closed issues
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+12 −3
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ class IdlePulse(Operation):

class RampPulse(Operation):
    """
    The RampPulse Operation is a real-valued pulse that ramps from zero
    to the specified amplitude during the duration of the pulse.
    The RampPulse Operation is a real-valued pulse that ramps from the specified offset
    to the specified amplitude + offset during the duration of the pulse.
    """

    def __init__(
@@ -64,6 +64,7 @@ class RampPulse(Operation):
        amp: float,
        duration: float,
        port: str,
        offset: float = 0,
        clock: str = BasebandClockResource.IDENTITY,
        t0: float = 0,
        data: Optional[dict] = None,
@@ -74,12 +75,19 @@ class RampPulse(Operation):
        The RampPulse Operation is a real-valued pulse that ramps from zero
        to the specified amplitude during the duration of the pulse.

        The pulse is given as a function of time :math:`t` and the parameters offset and amplitude by

        .. math::
            P(t) = \mathrm{offset} + t * \mathrm{amp}

        Parameters
        ----------
        amp
            Final amplitude of the ramp envelope function.
            Amplitude of the ramp envelope function.
        duration
            The pulse duration in seconds.
        offset:
            Starting point of the ramp pulse
        port
            Port of the pulse.
        clock
@@ -102,6 +110,7 @@ class RampPulse(Operation):
                        "wf_func": "quantify_scheduler.waveforms.ramp",
                        "amp": amp,
                        "duration": duration,
                        "offset": offset,
                        "t0": t0,
                        "clock": clock,
                        "port": port,
+2 −2
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ def square_imaginary(
    return square(t, 1j * amp)


def ramp(t, amp) -> np.ndarray:
    return np.linspace(0, amp, len(t))
def ramp(t, amp, offset=0) -> np.ndarray:
    return np.linspace(offset, amp + offset, len(t))


def staircase(