DifferentialTimeStepper

class photonforge.DifferentialTimeStepper(*, scheme='backwards', scale=1.0, output_port=None)[source]

Time stepper for differentiating electrical signals in time.

The “backwards” scheme, implements:

\[y_k = s \frac{x_k - x_{k-1}}{\Delta t}\]

whereas the “central” scheme uses:

\[y_k = s \frac{x_k - x_{k-2}}{2 \Delta t}\]
Parameters:
  • scheme (Literal['backwards', 'central']) – Differentiation scheme.

  • scale (Annotated[float, units='s']) – Output scaling factor \(s\).

  • output_port (str | None) – Name of the port used as output. If None, the last port is used (in the sorted list of ports).

Methods

bind_native(step, keys[, state, cstate, context])

Bind a compiled step function.

reset()

Reset any internal state of the time stepper.

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

Initialize the time stepper.

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

Initialize internal state.

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

Compute the outputs of this time stepper, given inputs.

step_single(inputs, outputs, time_index, ...)

Take a single time step on the given inputs.

update(*args, **kwargs)

Update this time stepper.

write_verilog_a(path, *[, backend, ...])

Write this configured time stepper as one Verilog-A module.

Attributes

parametric_function

Function used to update the time stepper.

parametric_kwargs

Keyword arguments used to update the time stepper.

path_delays

Minimum delay in time steps of each (input key, output key) signal path; missing pairs have no path and None means every input reaches every output within the time step.

properties

Object properties.

random_variables

Random variables associated to the time stepper's parameters.

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

Initialize internal state.

Parameters:
  • time_step (float) – The interval between time steps (in seconds).

  • component (Component) – Component representing the time stepper.

  • kwargs (object) – Unused.

Return type:

None