PoleResidueMatrix

class photonforge.PoleResidueMatrix(poles, residues, frequency_scaling=6.283185, ports=None)

Pole-residue representation of an S matrix.

Each element $v$ is represented by a rational function of the form:

\[S_v = \sum_{n=0}^{N-1} \frac{r_{vn}}{s - p_n} + r_{vN}\]

in which $p_n$ are the poles (shared by all elements) and $r_{vn}$ are the residues for element $v$, $h$ is a frequency scaling factor, and $s = -i h f$.

Parameters:
  • poles – Sequence of complex poles shared by all matrix elements.

  • residues – Dictionary of residues, one per matrix element. Each item is a sequence of complex residues used for that element.

  • frequency_scaling – Scaling applied to the frequencies in evaluation.

  • ports – Mapping from port names to ports or to None.

Note

The number of residues for each element is 1 more that the number of poles because of the last term in the representation.

Example

An SMatrix instance can be obtained by calling an instance of PoleResidueMatrix with the desired frequencies:

>>> pole_res = PoleResidueMatrix(
...     poles=[-C_0 / 1.0],
...     residues={("P0", "P0"): [2.0 * C_0, 0.0]},
... )
>>> s_matrix = pole_res(C_0 / 1.55)
>>> s_matrix.elements
{('P0', 'P0'): array([0.11473006+0.46507755j])}

Methods

copy()

Create a copy of this pole_residue_matrix.

Attributes

frequency_scaling

Frequency scaling factor

poles

Poles for all elements (read only).

ports

Associated ports (read only).

residues

Dictionary of residues for each element (read only).

copy()

Create a copy of this pole_residue_matrix.

Returns:

New copy.

frequency_scaling

Frequency scaling factor

poles

Poles for all elements (read only).

ports

Associated ports (read only).

residues

Dictionary of residues for each element (read only).