# ipkiss3.all.CompactModel¶

class ipkiss3.all.CompactModel(**kwargs)

Base class to define a compact model, which approximates the behavior of a device using an S-matrix or a set of differential equations.

Our circuit simulator Caphe can then interprete these compact models to run circuit simulations.

See also the tutorial on implementing circuit models to learn how to create your own compact models. Below is an example of a simple compact model:

import ipkiss3.all as i3

class MyModel(i3.CompactModel):

# list all the parameters that are used in your model
parameters = [
'width',
'transmission'
]

# you can provide defaults for the parameters:
width = 1.0

# list the terms of your model
terms = [
i3.OpticalTerm(name='in', n_modes=2),
i3.OpticalTerm(name='out', n_modes=2),
]

# When you're defining a stateful model,
# list the states here.
states = [
'some_state'
]

def calculate_smatrix(parameters, env, S):
# in calculate_smatrix you can define the
# frequency response of your model
S['in', 'out'] = 1.0

def calculate_signals(parameters, env, output_signals, y, t, input_signals):
# Define output_signals as function of time (t), states (y), and input_signals
pass

def calculate_dydt(parameters, env, dydt, y, t, input_signals):
# Define dy/dt (dydt) as function of time (t), states (y), and input_signals
pass

calculate_dydt = None
calculate_signals = None
calculate_smatrix = None
netlist = <Netlist with 0 terms, 0 nets and 0 instances
parameters = []
states = []
terms = []