map_terms

ipkiss3.all.circuit_sim.map_terms(model, term_names)

Map the terms of a model to different names

Parameters:
model: i3.CompactModel

The model to map the terms of

term_names: Dict[str, str]

Mapping model_term_name: new_name. Model terms not specified will be used without renaming

Examples

>>> class MyModel(i3.CompactModel):
>>>    terms = [i3.OpticalTerm(name="in"), i3.OpticalTerm(name="out")]
>>>    parameters = ['a']
>>>
>>> class MyPCell(i3.PCell):
>>>
>>>     class CircuitModel(i3.CircuitModelView):
>>>         def _generate_model(self):
>>>             model = MyModel(a=2.)
>>>             return i3.circuit_sim.map_terms(
>>>                 model,
>>>                 term_map={"in": "opt1", "out": "opt2"}
>>>             )