3.2.1.2. lekkersim.SolvedModel

class lekkersim.SolvedModel(pin_dic: Dict[Pin, int], param_dic: Dict[str, Any], Smatrix: ndarray, int_func: Callable | None = None, monitor_mapping: Dict[str, Tuple[Structure, str]] | None = None, name: str | None = None)

Class for storing data of a solver mode.

Do not use this class directly. It is returned from all solve methods. It is convenient for extracting data

__init__(pin_dic: Dict[Pin, int], param_dic: Dict[str, Any], Smatrix: ndarray, int_func: Callable | None = None, monitor_mapping: Dict[str, Tuple[Structure, str]] | None = None, name: str | None = None) None

Initialize the model

Parameters:
  • pin_dic (dictionary) – list of strings containing the model’s pin names

  • param_dic (dictionary) – dictionary {‘param_name’:param_value} containing the definition of the model’s parameters.

  • Smatrix (ndarray) – Fixed S_matrix of the model

  • int_func (Callable) – function for returning the modal coefficient in between two part of the scattering matrix

  • monitor_mapping (Dict) – Dictionry mapping the name of the monitor to the connected pin

  • name (str) – name of the solved model

Methods

S2PD([func])

Function for returning the Scattering Matrix as a PD Dataframe

__init__(pin_dic, param_dic, Smatrix[, ...])

Initialize the model

create_S()

Function for returning the scattering matrix of the model

expand_mode(mode_list)

This function expands the model by adding additional modes.

export_InPulse([filename, ...])

Export scattering matrix in InPulse format

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_data(pin1, pin2)

Function for returning transmission data between two ports

get_full_data()

Returns the scattering matrix for all the solved parametes in form of padas DataFrame

get_full_output(input_dic[, power])

Function for getting the output do the system given the inputs

get_monitor(input_dic[, power])

Function for returning data from monitors

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

set_intermediate(int_func, monitor_mapping)

Methods for setting the function and mapping for monitors

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()