BraggGratingModel

class photonforge.BraggGratingModel(*, period, num_periods, coupling_coefficient, n_eff, n_group=None, reference_frequency=None, order=1, loss=0.0, apodization='uniform', apodization_parameter=3.0, phase_shifts=(), num_sections=None, ports=None)[source]

Waveguide Bragg grating from coupled-mode theory.

Two counter-propagating modes exchange power along the grating,

\[ \begin{align}\begin{aligned}\frac{{\rm d}A}{{\rm d}z} = i\hat\sigma A + i\kappa B\\\frac{{\rm d}B}{{\rm d}z} = -i\hat\sigma B - i\kappa^{*}A\\\hat\sigma = 2\pi n_{\rm eff}/\lambda-m\pi/\Lambda\end{aligned}\end{align} \]

for grating order \(m\). Each section of length \(\ell\) has the closed-form solution

\[ \begin{align}\begin{aligned}\gamma = \sqrt{|\kappa|^2 - \hat\sigma^2}\\S = \frac{\sinh\gamma\ell}{\gamma}\\D = \cosh\gamma\ell + i\hat\sigma S\\r = \frac{i\kappa^{*}S}{D}\\t = \frac{1}{D}\end{aligned}\end{align} \]

written with \(S\) rather than \(\sinh\gamma\ell\) so the \(\gamma\to 0\) limit at the band edge is taken analytically. Discretization only matters when the grating varies along its length.

Parameters:
  • period (Annotated[float, exclusiveMinimum=0, units='μm'] | Sequence[Annotated[float, exclusiveMinimum=0, units='μm']] | Expression | Interpolator | str) – Grating period \(\Lambda\). A 1D array, Interpolator, Expression or expression string over the normalized position u in [0, 1] gives an arbitrary chirp profile.

  • num_periods (Annotated[int, exclusiveMinimum=0]) – Number of grating periods.

  • coupling_coefficient (Annotated[float, minimum=0, units='μm⁻¹']) – Peak coupling \(\kappa\). Scaled along the grating by apodization.

  • n_eff (Annotated[float, exclusiveMinimum=0] | Interpolator) – Effective index of the unperturbed waveguide, or an Interpolator over frequency for full dispersion.

  • n_group (Annotated[float, exclusiveMinimum=0] | None) – Group index. With reference_frequency this adds first-order dispersion to a scalar n_eff. Ignored if n_eff is an Interpolator.

  • reference_frequency (Annotated[float, minimum=0, units='Hz'] | None) – Frequency at which a scalar n_eff applies.

  • order (Annotated[int, exclusiveMinimum=0]) – Grating order \(m\).

  • loss (Annotated[float, minimum=0, units='dB/μm']) – Power propagation loss of the underlying waveguide, in dB/μm.

  • apodization (Literal['uniform', 'gaussian', 'raised-cosine', 'blackman'] | ~collections.abc.Sequence[float] | ~photonforge.Interpolator | ~photonforge.Expression | str) – Profile of \(\kappa\) along the grating: one of "uniform", "gaussian", "raised-cosine", "blackman", a 1D array, Interpolator, Expression or expression string in u over [0, 1] for an arbitrary analytic window.

  • apodization_parameter (float) – Shape parameter for "gaussian" and "raised-cosine".

  • phase_shifts (Sequence[tuple[Annotated[float, maximum=1, minimum=0], Annotated[float, units='rad']]]) – Sequence of (position, phase) pairs, with position the normalized coordinate u in [0, 1] and phase in radians. Each applies a step in the grating phase from that point on, so a phase of \(\pi\) is the standard quarter-wave shift and opens a transmission resonance at the Bragg wavelength.

  • num_sections (Annotated[int, exclusiveMinimum=0] | None) – Number of sections used to discretize the grating. If None, min(num_periods, 400) is used.

  • ports (Annotated[Sequence[str], maxItems=2, minItems=2] | None) – Input and output port names. If not set, the sorted list of port names of the relevant classification is used.

Note

The average index change that usually accompanies apodization, which chirps the local Bragg wavelength unless it is compensated, is not modelled. Supply it through period if it matters.

Reference:

Erdogan, T. (1997). Fiber grating spectra. Journal of Lightwave Technology, 15(8), 1277-1294.

Methods

autograd_smatrix(*, component, ...[, ...])

Compute an autograd-compatible S matrix for traced parameters.

black_box_component([port_spec, technology, ...])

Create a black-box component using this model for testing.

bragg_wavelength([frequency])

Bragg wavelength from the mean period and the effective index.

estimate_cost(*args, **kwargs)

Estimate the cost for S matrix computation.

s_matrix(component, frequencies[, ...])

Compute the S matrix for a component using this model.

sections()

Per-section coupling, period and length.

setup_time_stepper(component, time_step[, ...])

Obtain a time stepper for a component using this model.

start(component, frequencies, **kwargs)

Start computing the S matrix response from a component.

transform([translation, rotation, scaling, ...])

Apply a transformation to this model.

update(*args, **kwargs)

Update this model.

Attributes

parametric_function

Function used to update the model.

parametric_kwargs

Keyword arguments used to update the model.

properties

Object properties.

random_variables

Random variables associated to the model's parameters.

time_stepper

Time stepper associated with this model.

black_box_component(port_spec=None, technology=None, name=None)[source]

Create a black-box component using this model for testing.

Parameters:
  • port_spec (str | PortSpec | None) – Port specification used in the component. If None, look for "port_spec" in config.default_kwargs.

  • technology (Technology | None) – Component technology. If None, the default technology is used.

  • name (str | None) – Component name. If None a default is used.

Returns:

Component with 2 ports and this model.

Return type:

Component

bragg_wavelength(frequency=None)[source]

Bragg wavelength from the mean period and the effective index.

Parameters:

frequency (float | None) – Frequency at which to evaluate a dispersive n_eff. If None, reference_frequency is used.

Returns:

Bragg wavelength in μm.

Return type:

float

sections()[source]

Per-section coupling, period and length.

Returns:

Tuple (kappa, period, length), each of length num_sections. kappa is complex and already carries the apodization and the cumulative grating phase from phase_shifts.

Return type:

tuple[ndarray, ndarray, ndarray]

start(component, frequencies, **kwargs)[source]

Start computing the S matrix response from a component.

Parameters:
  • component (Component) – Component from which to compute the S matrix.

  • frequencies (Sequence[float]) – Sequence of frequencies at which to perform the computation.

  • **kwargs (object) – Unused.

Returns:

S matrix for the requested frequencies, including reflection.

Return type:

SMatrix