DirectionalCouplerModel¶
- class photonforge.DirectionalCouplerModel(t=2**-0.5, c=-1j * 2**-0.5, i=0, r=0, ports=None)[source]¶
Analytic model for a 4-port directional coupler
\[\begin{split}S = \begin{bmatrix} r & i & t & c \\ i & r & c & t \\ t & c & r & i \\ c & t & i & r \\ \end{bmatrix}\end{split}\]- Parameters:
t (complex | ndarray) – Transmission coefficient. For multimode ports, a sequence of coefficients must be provided.
c (complex | ndarray) – Coupling coefficient. For multimode ports, a sequence of coefficients must be provided.
i (complex | ndarray) – Isolation coefficient. For multimode ports, a sequence of coefficients must be provided.
r (complex | ndarray) – Reflection coefficient. For multimode ports, a sequence of coefficients must be provided.
ports (Sequence[str] | None) – List of port names. If not set, the sorted list of port names from the component is used.
Notes
For multimode ports, mixed-mode coefficients are zero (not included in the result). Dispersion can be included in the model by setting the coefficients to a 2D array with shape (M, N), in which M is the number of modes, and N the length of the frequency sequence used in the S matrix computation.
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.
properties
Object properties.
random_variables
Random variables associated to this modles's parameters.
- property as_bytes: bytes¶
Serialize this model.
- classmethod from_bytes(byte_repr)[source]¶
De-serialize this model.
- Parameters:
byte_repr (bytes)
- Return type:
- 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 (Any) – Unused.
- Returns:
Model result with attributes
status
ands_matrix
.- Return type: