3.2.3.9. lekkersim.Model_from_InPulse

class lekkersim.Model_from_InPulse(file: str, parameter_name_mapping: Dict[str, str] | None = None, mode_mapping: Dict[str, str] | None = None)

Class for model from InPulse S-Matrix RAW DATA file

__init__(file: str, parameter_name_mapping: Dict[str, str] | None = None, mode_mapping: Dict[str, str] | None = None) None

Initialize the model

Parameters:
  • file (str) – Path of the file to be loaded.

  • parameter_name_mapping (dict[str,str]) – mapping of the parameter name between the file and the model. The format is {‘<file-parameter-name>’:’<model-parameter-name>’} Parameters not provided retain theur original name. Example: Wavelength is usually called ‘wl’ in gensol, but it may be ‘wavelength’ in the file. To uniform the model to the other provide the mapping {“wavelength”:”wl”}

  • mode_mapping (dict[str,str]) – mapping between the mode names in the file and the model. The format is {‘<file-mode-name>’:’<model-mode-name>’} If nothing is provided, all the modes are loaded with their original name. This will create multiple pins in the model with name ‘<pin-name>_<mode-name>’ If a dictionary is provided, only the mapped modes are loaded and the names are changed accordingly. If a mode is mapped to the empty string (”” or ‘’), the result port name is just <pin-name>

Returns:

None

Methods

S2PD([func])

Function for returning the Scattering Matrix as a PD Dataframe

__init__(file[, parameter_name_mapping, ...])

Initialize the model

create_S()

Returns the scattering matrix of the model

expand_mode(mode_list)

This function expands the model by adding additional modes.

get_A(pin1, pin2)

Function for returning complex amplitude of the transmission between two ports

get_PH(pin1, pin2)

Function for returning the phase of the transmission between two ports

get_T(pin1, pin2)

Function for returning the energy transmission between two ports

get_output(input_dic[, power])

Returns the outputs from all ports of the model given the inputs amplitudes

get_pin_basenames()

Returns a list of the basenames of the pins

get_pin_modes(basename)

Parse the pins for locating the pins with the same base name

inspect()

Function that print self.

is_empty()

Checks if model is empy

pin_mapping(pin_mapping)

Function for changing the names of the pins of a model

print_S([func])

Function for nice printing of scattering matrix in agreement with pins

prune()

Check if the model is empty

put([source_pin, target_pin, param_mapping])

Function for putting a model in a Solver object, and eventually specify connections

show_free_pins()

Function for printing pins of model

solve(**kargs)

Function for returning the solved model

update_params(update_dic)

Update the parameters of model, setting defaults when value is not provides

update_pins()