WaveformTimeStepper

class photonforge.WaveformTimeStepper(*, frequency, amplitude=, offset=, start=None, stop=None, waveform="sine", skew=0.5, width=0.5, rise=0, fall=0, order=1, noise=, jitter=0, prbs=0, seed=None)[source]

Time-stepper for a signal generator from several waveforms.

Parameters:
  • frequency (Annotated[float, minimum=0, units='Hz']) – Source frequency. The carrier frequency, if any, is not taken into account. The generated signals are always real. This is equivalent to the bit rate for PRBS signals.

  • amplitude (Annotated[float, units='√W']) – Source amplitude. Sine and triangle waves range from offset - amplitude to offset + amplitude. Other waveforms range from offset to offset + amplitude.

  • offset (Annotated[float, units='√W']) – Constant source offset.

  • start (Annotated[float, units='s'] | None) – Start time of the source.

  • stop (Annotated[float, units='s'] | None) – Stop time of the source. The effective stop time is after the current pulse finishes, so it can be after stop.

  • waveform (Literal['sine', 'triangle', 'trapezoid', 'raised-cosine', 'gaussian']) – Source waveform.

  • skew (Annotated[float, maximum=1, minimum=0]) – Triangle wave asymmetry parameter. A value of 1 produces a sawtooth wave, whereas a value of 0, a reversed sawtooth.

  • width (Annotated[float, minimum=0]) – Full-width at half-maximum (FWHM) for trapezoid, raised- cosine, and Gaussian pulses, as a fraction of the source period.

  • rise (Annotated[float, minimum=0]) – Trapezoidal and raised-cosine pulses rise time, as a fraction of the source period.

  • fall (Annotated[float, minimum=0]) – Trapezoidal and raised-cosine pulses fall time, as a fraction of the source period.

  • order (Annotated[float, minimum=1]) – Order of the super-Gaussian pulse.

  • noise (Annotated[float, minimum=0, units='√(W/Hz)']) – One-sided, amplitude spectral density (ASD) of noise.

  • jitter (Annotated[float, minimum=0, units='s']) – RMS clock jitter.

  • prbs (Literal[0, 7, 15, 31]) – PRBS polinomial degree. Value 0 disables PRBS.

  • seed (Annotated[int, minimum=0] | None) – Random number generator seed to ensure reproducibility.

Note

Pseudorandom bit sequences (PRBS) can be used with any waveform, but trapezoid and raised-cosine are more appropriate. With those, return-to-zero (RZ) coding can be set with width = 0.5, and non-return-to-zero (NRZ) with width = 1 + 0.5 * (rise + fall).

Important

The effective clock jitter can be larger than specified due to the size of the time step. The larger the jitter value w.r.t the time_step, the better it can be simulated.

Methods

reset()

Reset internal state.

setup(component, time_step, *[, ...])

Initialize the time stepper.

setup_state(*, component, time_step, **kwargs)

Initialize internal state.

step([inputs, steps, time_step, show_progress])

Compute the outputs of this time stepper, given inputs.

step_single(inputs, time_index, ...)

Take a single time step on the given inputs.

update(*args, **kwargs)

Update this time stepper.

Attributes

parametric_function

Function used to update a parametric component.

parametric_kwargs

Keyword arguments used to update a parametric component.

properties

Object properties.

random_variables

Random variables associated to this modles's parameters.

reset()[source]

Reset internal state.

setup_state(*, component, time_step, **kwargs)[source]

Initialize internal state.

Parameters:
  • component (Component) – Component representing the laser source.

  • time_step (Annotated[float, minimum=0, units='s']) – The interval between time steps (in seconds).

  • kwargs – Unused.

step_single(inputs, time_index, update_state, shutdown)[source]

Take a single time step on the given inputs.

Parameters:
  • inputs (dict[str, complex]) – Dictionary containing inputs at the current time step, mapping port names to complex values.

  • time_index (int) – Time series index for the current input.

  • update_state (bool) – Whether to update the internal stepper state.

  • shutdown (bool) – Whether this is the last call to the single stepping function for the provided TimeSeries.

Returns:

Outputs at the current time step.

Return type:

dict[str, complex]