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,Expressionor expression string over the normalized positionuin [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
Interpolatorover frequency for full dispersion.n_group (Annotated[float, exclusiveMinimum=0] | None) – Group index. With
reference_frequencythis adds first-order dispersion to a scalarn_eff. Ignored ifn_effis anInterpolator.reference_frequency (Annotated[float, minimum=0, units='Hz'] | None) – Frequency at which a scalar
n_effapplies.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,Expressionor expression string inuover [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 coordinateuin [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
periodif 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_functionFunction used to update the model.
parametric_kwargsKeyword arguments used to update the model.
propertiesObject properties.
random_variablesRandom variables associated to the model's parameters.
time_stepperTime 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"inconfig.default_kwargs.technology (Technology | None) – Component technology. If
None, the default technology is used.name (str | None) – Component name. If
Nonea default is used.
- Returns:
Component with 2 ports and this model.
- Return type:
- 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. IfNone,reference_frequencyis used.- Returns:
Bragg wavelength in μm.
- Return type:
float
- sections()[source]¶
Per-section coupling, period and length.
- Returns:
Tuple
(kappa, period, length), each of lengthnum_sections.kappais complex and already carries the apodization and the cumulative grating phase fromphase_shifts.- Return type:
tuple[ndarray, ndarray, ndarray]