Skip to content

Convenience functions for pulses #35

@RemDelaporteMathurin

Description

@RemDelaporteMathurin

It would be convenient to have functions like periodic step function, periodic step function with ramp up/down etc.

def periodic_step_function(x, period_on, period_total, value_on, value_off=0.0):
    """
    Creates a periodic step function with two periods.
    """

    if period_total < period_on:
        raise ValueError("period_total must be greater than period_on")
    
    if x % period_total < period_on:
        return value_on
    else:
        return value_off

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions