Skip to main content

t_funcs.square

t_funcs.square(index)

Return a square (top-hat) pulse time function.

Parameters

Name Type Description Default
index int Integer suffix used to look up parameters in args. required

Returns

Name Type Description
TFunc Callable f(t, args) reading on_{index}, off_{index} and
TFunc either ampl_{index} or n_pi_{index} from args. Returns
TFunc ampl between on and off, zero outside. Raises KeyError
TFunc if both or neither amplitude parameters are present, and
TFunc ValueError if n_pi is used with off <= on.

Notes

The amplitude can be set directly via ampl_{index} or indirectly via n_pi_{index} (desired pulse area in multiples of π).