model_setup_info

circuit_analyzer.all.model_setup_info(circuit_model, verbose=True)

Returns Circuit Analyzer model setup information for a specific CircuitModel.

This is useful to figure out if the configuration is correct and is picking up the relevant variability models.

Parameters:
circuit_model: CircuitModel

IPKISS CircuitModel used in the simulation.

verbose: bool, default True

Defines if the resulting model info should be printed to standard output.

wavelengths: array-like
Returns:
matches: dict[(str, str): Cell]

Dictionary with (lib_name, cell_name): Cell (where Cell contains the configuration) Circuit Analyzer will use them when doing Corner Analysis, Monte Carlo Analysis

not_in_lib: List[(str, str)]

List of cells that do not have a config, but the library is known in the configuration.

not_in_config: List[(str, str)]

List of cells that are not in the configuration.

Examples

With models.yaml:

ipkiss3:
  RoundedWaveguide:
    parameters:
      t:
        doc: "Thickness of the waveguide"
        default: 0
        corners: [ 0.21, 0.22, 0.23]
    generate_parameters: "models.waveguide_to_model_parameters"

and models.py defined as:

from ipkiss3.pcell.photonics.waveguide import TemplatedWindowWaveguide

def waveguide_to_model_parameters(
    self: TemplatedWindowWaveguide.CircuitModel,
    **corners,
):
    def fn(x):
        return 1 + x / 50

    return {"n_eff": fn(corners["t"])}

model_setup_info allows you to summarize how the variability configuration defined in models.yaml applies to your design:

import ipkiss3.all as i3
import circuit_analyzer.all as ca

cell = i3.RoundedWaveguide()
lay = cell.Layout()
cm = cell.CircuitModel()

with ca.setup("."):
    ca.model_setup_info(cm)

outputs

Cells with config:

{
  (
    'ipkiss3',
    'RoundedWaveguide',
  ): Cell(
       name='RoundedWaveguide',
       parameters=[
         Parameter(name='t', doc='Thickness of the waveguide', default=0, corners=[0.21, 0.22, 0.23]),
       ],
       generate_parameters='models.waveguide_to_model_parameters',
       filename_format=None,
     )
}
Cells without config (but library to which it belongs is known): [('ipkiss3', 'TemplatedWindowWaveguide')]
Cells without config (also no library config): []