Transitions¶
Transitions between two trace templates are derived from the base class TraceTransition
.
Linear, parabolic and exponential transitions are defined.
The polygon discretization is uniformly performed with respect to the width of the trace, with steps along the axis of propagation taken to match these widths.
So, the transitions work with the inverse of the function \(width=f(x)\) with \(x\) the axis of the transition and \(f\) linear, parabolic or exponential.
- class ipkiss3.all.LinearWindowTraceTransition(*args, **kwargs)¶
Linear transition between two window trace templates
- Parameters
- end_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
second window trace template
- start_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
first window trace template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Views
- Layout = <class 'ipkiss3.pcell.trace.transitions.linear.LinearWindowTraceTransition.Layout'>¶
- class ipkiss3.all.ParabolicWindowTraceTransition(*args, **kwargs)¶
Parabolic transition between two window trace templates
- Parameters
- end_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
second window trace template
- start_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
first window trace template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Views
- Layout = <class 'ipkiss3.pcell.trace.transitions.parabolic.ParabolicWindowTraceTransition.Layout'>¶
- class ipkiss3.all.ExponentialWindowTraceTransition(*args, **kwargs)¶
Exponential transition between two window trace templates
- Parameters
- end_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
second window trace template
- start_trace_template: PCell and _TraceTemplate and WindowTraceTemplate
first window trace template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Views
- Layout = <class 'ipkiss3.pcell.trace.transitions.exponential.ExponentialWindowTraceTransition.Layout'>¶
Waveguide transitions¶
The photonic implementation of trace transitions are waveguide transitions, also called tapers or mode converters.
- class ipkiss3.all.LinearWindowWaveguideTransition(*args, **kwargs)¶
Linear waveguide transition (taper) for window waveguide templates
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2]) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2]) t = i3.LinearWindowWaveguideTransition(start_trace_template=wt1, end_trace_template=wt2) t_lay = t.Layout(start_position=(0.0, 0.0), end_position=(5.0, 0.0)) t_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.linear.LinearWindowWaveguideTransition.Layout'>¶
- class ipkiss3.all.ParabolicWindowWaveguideTransition(*args, **kwargs)¶
Parabolic waveguide transition (taper) for window waveguide templates
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2]) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2]) tp = i3.ParabolicWindowWaveguideTransition(start_trace_template=wt1, end_trace_template=wt2) tp_lay = tp.Layout(start_position=(0.0, 0.0), end_position=(5.0, 0.0)) tp_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.parabolic.ParabolicWindowWaveguideTransition.Layout'>¶
- class ipkiss3.all.ExponentialWindowWaveguideTransition(*args, **kwargs)¶
Exponential waveguide transition (taper) for window waveguide templates
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2], core_width=0.2) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2], core_width=0.8) tp = i3.ExponentialWindowWaveguideTransition(start_trace_template=wt1, end_trace_template=wt2) tp_lay = tp.Layout(start_position=(0.0, 0.0), end_position=(5.0, 0.0)) tp_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.exponential.ExponentialWindowWaveguideTransition.Layout'>¶
Waveguide transitions starting from a port¶
Transitions starting from a port of a PCell. Given a length, the transition properties are calculated using the trace template, position and angle given by the start port.
- class ipkiss3.all.LinearWindowWaveguideTransitionFromPort(*args, **kwargs)¶
Linear waveguide transition (taper) starting from a port with a window waveguide template
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- start_port: _PortInterface
the port on which to extract trace template, position and angle
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2]) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2]) class ExampleCell(i3.PCell): class Layout(i3.LayoutView): def _generate_ports(self, ports): return i3.OpticalPort(name="out", position=(0.0, 0.0), angle=30.0, trace_template=wt1) example_cell = ExampleCell(name="example_cell_linearpt") t = i3.LinearWindowWaveguideTransitionFromPort(start_port=(example_cell, "out"), end_trace_template=wt2) t_lay = t.Layout(length=20.0) t_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.linear.LinearWindowWaveguideTransitionFromPort.Layout'>¶
- class ipkiss3.all.ParabolicWindowWaveguideTransitionFromPort(*args, **kwargs)¶
Parabolic transition (taper) starting from a port with a window waveguide template
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- start_port: _PortInterface
the port on which to extract trace template, position and angle
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2]) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2]) class ExampleCell(i3.PCell): class Layout(i3.LayoutView): def _generate_ports(self, ports): return i3.OpticalPort(name="out", position=(0.0, 0.0), angle=30.0, trace_template=wt1) example_cell = ExampleCell(name="example_cell_parabolicpt") t = i3.ParabolicWindowWaveguideTransitionFromPort(start_port=(example_cell, "out"), end_trace_template=wt2) t_lay = t.Layout(length=5.0) t_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.parabolic.ParabolicWindowWaveguideTransitionFromPort.Layout'>¶
- class ipkiss3.all.ExponentialWindowWaveguideTransitionFromPort(*args, **kwargs)¶
Exponential transition (taper) starting from a port with a window waveguide template
- Parameters
- end_trace_template: PCell and _WaveguideTemplate
second waveguide template
- start_trace_template: PCell and _WaveguideTemplate
first waveguide template
- start_port: _PortInterface
the port on which to extract trace template, position and angle
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
Examples
import ipkiss3.all as i3 wstart1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.1, end_offset=0.1) wstart2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wend1 = i3.PathTraceWindow(layer=i3.Layer(0), start_offset=-0.4, end_offset=0.4) wend2 = i3.PathTraceWindow(layer=i3.Layer(1), start_offset=-3, end_offset=3) wt1 = i3.WindowWaveguideTemplate() wt1.Layout(windows=[wstart1, wstart2], core_width=0.2) wt2 = i3.WindowWaveguideTemplate() wt2.Layout(windows=[wend1, wend2], core_width=0.8) class ExampleCell(i3.PCell): class Layout(i3.LayoutView): def _generate_ports(self, ports): return i3.OpticalPort(name="out", position=(0.0, 0.0), angle=30.0, trace_template=wt1) example_cell = ExampleCell(name="example_cell_exponentialpt") t = i3.ExponentialWindowWaveguideTransitionFromPort(start_port=(example_cell, "out"), end_trace_template=wt2) t_lay = t.Layout(length=5.0, g=3) t_lay.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.photonics.transitions.exponential.ExponentialWindowWaveguideTransitionFromPort.Layout'>¶
AutoTraceTransitionFromPort¶
AutoTraceTransitions work with an AutoTransitionDatabase that links combinations of trace templates with a transition class used to connect them.
- class ipkiss3.all.AutoTransitionDatabase(**kwargs)¶
AutoTransitionDatabase is a database that manages combinations of trace templates with transitions (tapers, converters) that can connect them. Use the add method to add a transition to the database. Use get_transition_class to extract a transition form the database.
- Parameters
- default: optional
Transition which is used if no match is found.
- default_if_identical: optional
Transition which is used if no match is found and the trace_templates are identical.
- indirection_table: optional
Lookup table that matches a trace templates to another trace template of which the transitions are going to be used. Use treat_trace_template_as to add a pair of trace templates to that list.
- lookup_table: optional
Lookup table that contains the combinations of trace templates and matching transition classes.It is not recommended to set this object directly when creating your own database. Instead, use the add method.
Examples
from ipkiss3.pcell.trace.transitions.auto_transition.auto_transition_db import AutoTransitionDatabase from ipkiss3.pcell.trace.trace import TraceTemplate from ipkiss3.pcell.trace.transition import TraceTransitionFromPort tdb = AutoTransitionDatabase() # Trace template 1 class TraceTemplate1(TraceTemplate): pass # Trace template 2 class TraceTemplate2(TraceTemplate): pass # Trace that will use indirection class TraceTemplateInderection(TraceTemplate): pass # Trace not represented in the db class TraceTemplateNotInDb(TraceTemplate): pass # Transition 1 class Transition1(TraceTransitionFromPort): pass # Transition 2 class Transition2(TraceTransitionFromPort): pass # Transition used when not in database and not identical class TransitionDefault(TraceTransitionFromPort): pass # Transition used when not in database and identical class TransitionDefaultIndentical(TraceTransitionFromPort): pass tdb = AutoTransitionDatabase(default=TransitionDefault, default_if_identical=TransitionDefaultIndentical) tdb.treat_trace_template_as(TraceTemplateInderection, TraceTemplate2) # Adding the trace templates tdb.add(TraceTemplate1, TraceTemplate1, Transition1) # Adding the trace templates tdb.add(TraceTemplate2, TraceTemplate1, Transition1) # Adding the trace templates tdb.add(TraceTemplate1, TraceTemplate2, Transition1) # Adding the trace templates tdb.add(TraceTemplate2, TraceTemplate2, Transition2) print(tdb.get_transition_class(TraceTemplate1(), TraceTemplate1())) print(tdb.get_transition_class(TraceTemplate2(), TraceTemplate1())) print( tdb.get_transition_class(TraceTemplateInderection(), TraceTemplate2()) ) # just as if Transition2 Transition2 was asked print(tdb.get_transition_class(TraceTemplateNotInDb(), TraceTemplate1())) # Returns the default print( tdb.get_transition_class(TraceTemplateNotInDb(), TraceTemplateNotInDb()) ) # Returns the default if identical
- get_transition_class(start_trace_template, end_trace_template)¶
Gets the correct taper class for a certain start_trace_template and end_trace_template.
- Parameters
- start_trace_templatetrace template
trace template at the beginning of the taper.
- end_trace_templatetrace template
trace template at the end of the taper that must be accepted as end_trace_template by the taper_class.
- Returns
- taper class
Returns the correct taper class to connect start_trace_template with end_trace_template.
- add(start_trace_template_class, end_trace_template_class, taper_class)¶
Adds a combination start_trace_template, end_trace_template and taper_class to the autotaper dictionary.
- Parameters
- start_trace_template_classtrace template class
trace template class (not object) at the beginning of the taper that must be accepted as start_trace_template by the taper_class.
- end_trace_template_classtrace template class
trace template class (not object) at the end of the taper that must be accepted as end_trace_template by the taper_class.
- taper_classclass
Taper class that creates the taper. It should be an instance of TraceTransitionFromPort, otherwise it cannot be instantiated correctly.
- treat_trace_template_as(trace_template, other_trace_template)¶
Makes an indirection in the taper database so that trace_template is treated as other_treat_trace_template. Use this function when two different trace_template classes are similar enough they can use the same tapers.
- Parameters
- trace_templatetrace template
Trace template that you want make equivalent to other_trace_template.
- other_trace_template: trace template
Trace template of which the tapers will be used.
- class ipkiss3.all.AutoTraceTransitionFromPort(*args, **kwargs)¶
Automatically generates a transition based on a port and a waveguide definition, using a lookup table
- Parameters
- end_trace_template: PCell and _TraceTemplate
second trace template
- transition_database: AutoTransitionDatabase
AutoTransitionDatabase in which the correct transition between the two trace templates can be looked up.
- start_port: _PortInterface
the port on which to extract trace template, position and angle
- external_port_names: str
Dictionary for remapping of the port names of the contents to the external ports
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
- Other Parameters
- contents: PCell, locked
transition that is generated by this class
- reverse_templates: ( bool, bool_, bool or int ), locked
When True, treat start_trace_template as end_trace_template and vice versa. To use the correct templates, use the _{start/stop}_trace_template properties. This should not be set manually, but calculated by the transition itself.
- start_trace_template: PCell and _TraceTemplate, locked
Examples
from technologies import silicon_photonics # noqa: F401 from picazzo3.traces.rib_wg import RibWaveguideTemplate from picazzo3.traces.wire_wg import WireWaveguideTemplate import ipkiss3.all as i3 class MyCell(i3.PCell): class Layout(i3.LayoutView): def _generate_ports(self, ports): ports += i3.OpticalPort( name="in", position=(0.0, 0.0), angle=45.0, trace_template=RibWaveguideTemplate() ) return ports mycell = MyCell() attfp = i3.AutoTraceTransitionFromPort(start_port=(mycell, "in"), end_trace_template=WireWaveguideTemplate()) attfp_lay = attfp.Layout() attfp_lay.visualize(annotate=True)
from technologies import silicon_photonics # noqa: F401 from picazzo3.traces.rib_wg import RibWaveguideTemplate from picazzo3.traces.wire_wg import WireWaveguideTemplate import ipkiss3.all as i3 class MyCell(i3.PCell): class Layout(i3.LayoutView): def _generate_ports(self, ports): d = 5.0 for i in range(3): ports += i3.OpticalPort( name="in_{}".format(i), position=(0.0, d * i), angle=-30.0 + 30.0 * i, trace_template=RibWaveguideTemplate(), ) return ports class TaperedCell(i3.PCell): child = i3.ChildCellProperty() tapers = i3.ChildCellListProperty() exit_trace_template = i3.TraceTemplateProperty() def _default_exit_trace_template(self): return WireWaveguideTemplate() def _default_tapers(self): tapers = [] for i in range(3): t = i3.AutoTraceTransitionFromPort( start_port=(cell, "in_{}".format(i)), end_trace_template=self.exit_trace_template ) tapers.append(t) return tapers class Layout(i3.LayoutView): def _default_tapers(self): tapers = [] for i, t in enumerate(self.cell.tapers): t = t.get_default_view(i3.LayoutView) t.length = 10.0 tapers.append(t) return tapers def _generate_instances(self, insts): for i, t in enumerate(self.tapers): insts += i3.SRef(t, name="taper{}".format(i)) return insts cell = MyCell() exit_template = WireWaveguideTemplate() exit_template.Layout(core_width=0.5, cladding_width=2.0) tapered_cell = TaperedCell(child=cell, exit_trace_template=exit_template) lv = tapered_cell.Layout() lv.visualize(annotate=True)
Views
- Layout = <class 'ipkiss3.pcell.trace.transitions.auto_transition.auto_trace_transition.AutoTraceTransitionFromPort.Layout'>¶