DelayedTimeStepper¶
- class photonforge.DelayedTimeStepper(time_stepper=None, input_delay=0, output_delay=0)[source]¶
Time stepper that adds time delays to other time steppers.
- Parameters:
time_stepper (TimeStepper | None) – The time stepper to wrap with delays.
input_delay (Annotated[float, minimum=0, units='s']) – Default delay applied to the inputs.
output_delay (Annotated[float, minimum=0, units='s']) – Default delay applied to the outputs.
Methods
reset()Reset any internal state of the time stepper.
setup(component, time_step, *[, ...])Initialize the time stepper.
setup_state(*, time_step[, input_delays, ...])Initialize internal buffers and set port-specific delays.
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_functionFunction used to update a parametric component.
parametric_kwargsKeyword arguments used to update a parametric component.
propertiesObject properties.
random_variablesRandom variables associated to this modles's parameters.
- reset()[source]¶
Reset any internal state of the time stepper.
The default implementation performs no action. This method can be overridden in derived classes to reset any internal state the time stepper may have.
- setup_state(*, time_step, input_delays={}, output_delays={}, **kwargs)[source]¶
Initialize internal buffers and set port-specific delays.
- Parameters:
time_step (float) – The interval between time steps (in seconds).
input_delays (dict[str, Annotated[float, minimum=0, units='s']]) – Mapping of port names to delays to override the default input delay.
output_delays (dict[str, Annotated[float, minimum=0, units='s']]) – Mapping of port names to delays to override the default output delay.
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]