WaveguideModel¶
- class photonforge.WaveguideModel(n_complex=None, length=None, mesh_refinement=None, verbose=True)¶
Analytic model for straight waveguides.
The component is expected to have 2 ports with identical profiles. The S matrix is zero for all reflection or mixed-mode coefficients. Same-mode transmission coefficients are modeled by:
\[S_{jk} = \exp(i 2 \pi f n_c L / c₀)\]with \(n_c\) the complex effective index for the port profile modes, and \(L\) the waveguide length.
- Parameters:
n_complex (complex | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None) – Waveguide complex effective index. For multimode models, a sequence of indices must be provided, one for each mode. If not set, a mode solver will be used to compute it.
length (float | None) – Physical length of the waveguide. If not provided, the distance between ports is be used (assuming a straight waveguide).
mesh_refinement (float | None) – Minimal number of mesh elements per wavelength used for mode solving.
verbose (bool) – Flag setting the verbosity of mode solver runs.
Note
Dispersion can be included in the model by setting
n_complex
to a 2D array with shape (M, N), in which M is the number of modes in the waveguide, and N the length of the frequency sequence used in the S matrix computation.See also
Methods
from_bytes
(byte_repr)De-serialize this model.
s_matrix
(component, frequencies[, ...])Compute the S matrix for a component using this model.
start
(component, frequencies, **kwargs)Start computing the S matrix response from a component.
update
(*args, **kwargs)Update this model.
Attributes
Serialize this model.
parametric_function
Function used to update a parametric component.
parametric_kwargs
Keyword arguments used to update a parametric component.
random_variables
List of
monte_carlo.RandomVariable
associated to this component's parameters.- property as_bytes: bytes¶
Serialize this model.
- classmethod from_bytes(byte_repr)¶
De-serialize this model.
- Parameters:
byte_repr (bytes)
- Return type:
- start(component, frequencies, **kwargs)¶
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 – Unused.
- Returns:
Result object with attributes
status
ands_matrix
.- Return type:
ModelResult | _WaveguideModelRunner