finesse.components.modal.workspace module

class finesse.components.modal.workspace.KnmConnectorWorkspace(owner, sim, *args, **kwargs)[source]

Bases: ConnectorWorkspace

flag_changing_beam_parameters(self, OrderedSet changing_mismatch_edges)[source]

Iterate through all optical connections and checks/flag which optical connections need to having their scattering matrices recalculated. This occurs if the beam tracer traces some new q-parameters, or if an ABCD has a changing parameter, or if some optical path distortion map is changing.

Parameters

changing_couplingstuple

Tuple of (node_in, node_out) which must be recomputed.

Notes

changing_couplings typically comes from the trace forest`s method trace_forest.find_potential_mismatch_couplings. Which determines potential changes in mode scattering parameters, from changing ABCD properties.

has_changing_map(self, OrderedSet changing_parameters) dict
o2o
set_knm_info(self, connection, double[, : :1] abcd_x = abcd_unity, double[, : :1] abcd_y = abcd_unity, double nr_from=1, double nr_to=1, bool is_transmission=False, Parameter beta_x=None, double beta_x_factor=0, Parameter beta_y=None, double beta_y_factor=0, Parameter alpha=None, Map apply_map=None, double map_phase_factor=1, bool map_fliplr=False, bool apply_bayer_helms_first=False)[source]

Python facing method to set how Knm calculations should be handled for a particular connection. When the workspace is being created this should be called if modal simualtions are being used. This then sets which ABCD matricies to use, various parameters required, and whether the connection is a transmission or reflection.

This method should only be called once with the required settings. Calling it again will rewrite settings for this connection.

Parameters

abcd_x, abcd_ydouble[:,::1]

ABCD matrices that transform some input beam parameter to the output of this connection

nr_from, nr_todouble

refractive index at the input and output of this connection

is_transmissionbool

True if this connection represents a transmission through an element

beta_x, beta_yParameter

Parameter objects that reference a yaw (beta_x) and pitch (beta_y) misalignment

beta_x_factor, beta_y_factordouble

Scaling factor for misalignment parameters

alphaParameter

Macroscopic angle of incidence parameter for the element

apply_mapMap

When set this will apply the map object to this connection

map_fliplrbool

When True the map is flipped left-to-right when computing the scattering coefficients

apply_bayer_helms_firstbool

Composition order for connections that have both an analytic Bayer-Helms contribution and a numerical surface-map contribution. If False (default) the final scattering matrix is K = BH * MAP; if True, K = MAP * BH.

update_map_data(self)[source]