API Reference#

staaax.stratified(ds, ns, k0, kx, pol='s')[source]#

Sax Model Factory for stratified media.

           n0 ┊ n1 ┊           ┊ n_N+1   -> kz       ┊    ┊           ┊ |         inc ┊    ┊           ┊ V kx        \ ┊    ┊           ┊              \┊    ┊           ┊               +    ┊           ┊              /┊\   ┊           ┊             / ┊ \  ┊           ┊            /  ┊  \ ┊           ┊           /   ┊   \┊           ┊          /    ┊    +         \ ┊         /     ┊   /┊\   ooo   \┊        /      ┊  / ┊ \         +       /       ┊ /  ┊          /┊\      /        ┊/   ┊         / ┊ \
Parameters:
  • ds (List[float]) – Thicknesses of the layers (len(ds)=N).

  • ns (List[complex]) – Refractive indices of the layers (N+2 entries including halfspaces).

  • k0 (float) – Vacuum (angular) Wavenumber

  • kx (float) – Parallel component of the wavevector.

  • pol (str, optional) – Polarization, either “s” or “p”. Defaults to “p”.

Returns:

The sax model

Return type:

tuple[SDictModel, CircuitInfo]

staaax.fresnel.fresnel_kx_direct(ni=1, nj=1, k0=1, kx=0, pol='p', bc_angle_i=1.5707963267948966, bc_angle_j=1.5707963267948966, bc_width_i=0, bc_width_j=0, **kwargs)[source]#

Fresnel coefficients for planar optical interfaces under angled illumination.

           ni ┊ nj   -> kz       ┊ |         inc ┊ V kx        \ ┊              \┊               +              /┊\             / ┊ \          r /  ┊  \ t
Parameters:
  • ni (complex, optional) – Refractive index of medium i. Defaults to 1.

  • nj (complex, optional) – Refractive index of medium j. Defaults to 1.

  • k0 (float, optional) – Vacuum wavenumber (angular). Defaults to 1.

  • kx (float, optional) – Wavenumber component parallel to the interface. Defaults to 0.

  • pol (str, optional) – Polarization, either “s” or “p”. Defaults to “p”.

  • bc_angle_i (float, optional) – Branchcut angle for calculating kz in medium i. Defaults to jnp.pi/2.

  • bc_angle_j (float, optional) – Branchcut angle for calculating kz in medium j. Defaults to jnp.pi/2.

  • bc_width_i (float, optional) – Cutout around the branchcut yielding nans. Usefull for visualizing the BC. Defaults to 0.

  • bc_width_j (float, optional) – See bc_width_i. Defaults to 0.

Raises:

ValueError – Polarization should be either ‘s’/’TM’ or ‘p’/’TE’.

Returns:

The scattering matrix of the interface.

Return type:

sax.SDict

staaax.propagation.angled_sqrt(x, bc_angle=3.141592653589793, nan_tolerance=0)[source]#

Square root with adjusted direction of the branchcut.

Parameters:
  • x (complex) – Argument of the square root.

  • bc_angle (float, optional) – Angle of the branchcut. Defaults to pi.

  • nan_tolerance (float, optional) – Angle around the branchcut, for which to return nan. Defaults to 0.

Returns:

Square root of x.

Return type:

complex

staaax.propagation.propagation_kx(ni=1, di=1, k0=1, kx=0, bc_angle=1.5707963267948966, **kwargs)[source]#

Propagation S-matrix for a homogeneous layer.

Parameters:
  • ni (complex, optional) – Refractive Index. Defaults to 1.

  • di (float, optional) – Thickness of the layer. Defaults to 1.

  • k0 (float, optional) – Vacuum Wavenumber. Defaults to 1.

  • kx (float, optional) – Component of the wavevector parallel to the interfaces. Defaults to 0.

  • bc_angle (float, optional) – Branchcut angle. Defaults to pi/2.

Returns:

S-matrix of the propagation through the layer.

Return type:

sax.SDict

staaax.tildify.inverse_tildify(k_tilde, branchpoints, sign=1, normalize=False, single_branch=False)[source]#

Inverse coordinate transform corresponding to tildify.

Parameters:
  • k_tilde (complex) – Transformed space coordinate

  • branchpoints (List[complex]) – Branchpoints

  • sign (int, optional) – As in tildify.

  • normalize (bool, optional) – As in tildify.

  • single_branch (bool, optional) – Whether to return all possible branches, that could have lead to this coordinate in transformed space, or just a single one (False). Defaults to False.

Raises:

NotImplementedError – The inverse coordinate transform currently only supports 1 or 2 branchpoints.

Returns:

Untransformed space coordinate

Return type:

Complex

staaax.tildify.tildify(k, Cs, bcs, nan_tolerance=0, sign=1, normalize=False)[source]#

Coordinate transform to mitigate influence of square root type branch cuts. See also https://doi.org/10.1002/lpor.202500811

Parameters:
  • k (complex) – coordinate in untransformed space

  • Cs (List[complex]) – Branchpoints

  • bcs (List[float]) – Direction of the branchcuts (branch angles)

  • nan_tolerance (int, optional) – In this vicinity (in radian) to the branchcut the squareroot wil return nan. Defaults to 0.

  • sign (int, optional) – Used to flip the transform to allow for transforming kx instead of k0. Defaults to 1.

  • normalize (bool, optional) – If True, the transform is normalized by the sum of the branchpoints else the number of branchpoints is used for normalization. Defaults to False.

Returns:

transformed coordinate

Return type:

complex