CWLaserTimeStepper

class photonforge.CWLaserTimeStepper(*, power=1, rel_intensity_noise=0, linewidth=0, frequency=None, chirp_bandwidth=0, chirp_period=0, chirp_waveform='sawtooth', phase=0, reflection=0, seed=None)[source]

Time-stepper for a continuous-wave (CW) laser source.

This model generates a complex optical field with a constant average power. It can optionally include phase noise, modeled as a Lorentzian line width, and relative intensity noise (RIN) from a white noise process. The output field has the form:

\[A[k] = \sqrt{P[k]} e^{j\phi[k]}\]

The phase noise is modeled as a discrete-time Wiener process. The phase increment at each step is a Gaussian random variable with variance determined by the linewidth Δν as:

\[\text{Var}[\Delta\phi] = 2\pi \Delta\nu \Delta t\]

RIN is modeled as an additive white noise process on the optical power. The variance of the power fluctuations is derived from the RIN PSD, band-limited by the simulation’s Nyquist frequency, and clamped at zero:

\[\text{Var}[P] \approx \text{RIN} \frac{P_0^2}{2\Delta t}\]

A linear frequency chirp can be added on top, sweeping the instantaneous frequency over a band \(B\) centered on frequency, with period \(T\):

\[f[k] = f_0 + B d(k \Delta t / T)\]

in which \(d\) ramps from -1/2 to 1/2 over each period (sawtooth), or over each half period and back (triangle).

Parameters:
  • power (Annotated[float, minimum=0, units='W']) – Mean optical output power.

  • rel_intensity_noise (Annotated[float, minimum=0, units='1/Hz']) – One-sided relative intensity noise (RIN) power spectral density.

  • linewidth (Annotated[float, minimum=0, units='Hz']) – Full-width at half-maximum (FWHM) of the laser’s Lorentzian shape.

  • frequency (Annotated[float, minimum=0, units='Hz'] | None) – Absolute laser frequency. If None, equals the carrier frequency. If detuned from the carrier by Δf, the output envelope is \(e^{-j2\pi\Delta f\,t}\).

  • chirp_bandwidth (Annotated[float, minimum=0, units='Hz']) – Total frequency excursion of a linear sweep, centered on frequency. Zero disables the chirp.

  • chirp_period (Annotated[float, minimum=0, units='s']) – Duration of one complete sweep.

  • chirp_waveform (Literal['sawtooth', 'triangle']) – Sweep shape. A sawtooth ramps the optical frequency up over the period and resets; a triangle ramps it up over the first half of the period and back down over the second.

  • phase (Annotated[float, units='°']) – Starting phase of the output envelope.

  • reflection (complex) – Reflection coefficient for incident fields.

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

Note

PhotonForge uses the \(e^{-j\omega t}\) time convention, so an envelope \(e^{-j2\pi\Delta f\,t}\) is light at \(f_c + \Delta f\), with \(f_c\) the carrier frequency. The instantaneous frequency deviation of an output envelope a is therefore \(-(1/2\pi)\,{\rm d}\arg a/{\rm d}t\), for example -numpy.gradient(numpy.unwrap(numpy.angle(a)), time_step) / (2 * numpy.pi), and the frequency axis of a numpy.fft spectrum must be reversed.

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(*, component, time_step, ...)

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(*, component, time_step, carrier_frequency, **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).

  • carrier_frequency (Annotated[float, minimum=0, units='Hz']) – The carrier frequency used to construct the time stepper. The carrier should be omitted from the input signals, as it is handled automatically by the time stepper.

  • kwargs (object) – Unused.

Return type:

None