DirectionalCouplerModel

class photonforge.DirectionalCouplerModel(t=None, c=-1j * 2**-0.5, i=0, r=0, ports=None, *, propagation_length=.0, n_eff=0.0, n_group=None, reference_frequency=None)[source]

Data 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}\]

with coefficients:

\[ \begin{align}\begin{aligned}t' &= t e^{j \phi}\\c' &= c e^{j \phi}\\\phi &= \frac{2 \pi l_p}{c_0} [n_\text{eff} f_0 + n_\text{group} (f - f_0)]\end{aligned}\end{align} \]
Parameters:
  • t (complex | Sequence[complex] | Sequence[Sequence[complex]] | None) – Transmission coefficient. If None, it is calculated based on the magnitude of the other coefficients and the phase of c plus 90°.

  • c (complex | Sequence[complex] | Sequence[Sequence[complex]]) – Coupling coefficient.

  • i (complex | Sequence[complex] | Sequence[Sequence[complex]]) – Leakage (isolation) coefficient.

  • r (complex | Sequence[complex] | Sequence[Sequence[complex]]) – Reflection coefficient.

  • ports (Annotated[Sequence[str], maxItems=4, minItems=4] | None) – List of port names. If not set, the sorted list of port names from the component is used.

  • propagation_length (Annotated[float, units='μm']) – Propagation length \(l_p\) for dispersion modeling.

  • n_eff (complex | Sequence[complex] | Sequence[Sequence[complex]]) – Effective refractive index for dispersion modeling.

  • n_group (float | Sequence[float] | Sequence[Sequence[float]] | None) – Group index. If None, the value of n_eff is used.

  • reference_frequency (Annotated[float, minimum=0, units='Hz'] | None) – Reference frequency \(f_0\) for dispersion calculation. If None, the central frequency is used.

Notes

For multimode ports, a sequence of coefficients must be used, and mixed-mode coefficients are 0. 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

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

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

estimate_cost(*args, **kwargs)

Estimate the cost for S matrix computation.

from_bytes(byte_repr)

De-serialize this model.

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

Compute the S matrix for a component using this model.

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.

update(*args, **kwargs)

Update this model.

Attributes

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.

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 ports and model.

Return type:

Component

classmethod from_bytes(byte_repr)[source]

De-serialize this model.

Parameters:

byte_repr (bytes)

Return type:

DirectionalCouplerModel

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 and s_matrix.

Return type:

SMatrix