Transitions

Transitions between two trace templates are derived from the base class ipkiss3.pcell.trace.transition.TraceTransition.

Two specific implementations are the linear transition (i3.LinearWindowTraceTransition) and the parabolic transition (i3.ParabolicWindowTraceTransition) between two window trace templates.

class ipkiss3.all.LinearWindowTraceTransition(*args, **kwargs)

Linear transition between two window trace templates

Parameters:

end_trace_template: PCell and _TraceTemplate and WindowTraceTemplate, optional

second window trace template

start_trace_template: PCell and _TraceTemplate and WindowTraceTemplate, optional

first window trace template

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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
Parameters:

view_name: str, optional

The name of the view

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

length: float and Real, number and number >= 0, locked

length of the transition

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

Examples

import ipkiss3.all as i3
from ipkiss3.pcell.trace.window_trace import WindowTraceTemplate
from ipkiss3.pcell.trace.window.window import PathTraceWindow
from ipkiss.primitives.layer import Layer

# Windows
windows1 = [PathTraceWindow(layer=Layer(0), start_offset=0.6, end_offset=1.0),
           PathTraceWindow(layer=Layer(1), start_offset=-0.6, end_offset=-1.0),
           PathTraceWindow(layer=Layer(2), start_offset=-1.5, end_offset=1.5)
           ]
windows2 = [PathTraceWindow(layer=Layer(0), start_offset=0.2, end_offset=1.7),
           PathTraceWindow(layer=Layer(1), start_offset=-0.2, end_offset=-1.7),
           PathTraceWindow(layer=Layer(2), start_offset=-2.0, end_offset=2.0)
           ]

# Trace Templates
tt1 = WindowTraceTemplate(name="tt1")
tt1_layout = tt1.Layout(windows=windows1)
tt2 = WindowTraceTemplate(name="tt2")
tt2_layout = tt2.Layout(windows=windows2)

# linear transition
trans_lin = i3.LinearWindowTraceTransition(start_trace_template=tt1,
                                           end_trace_template=tt2)
trans_lin_lay = trans_lin.Layout(start_position=(0.0,0.0),
                                 end_position=(10.0,0.0))

trans_lin_lay.visualize()
../../_images/transition-1.png
class ipkiss3.all.ParabolicWindowTraceTransition(*args, **kwargs)

Parabolic transition between two window trace templates

Parameters:

end_trace_template: PCell and _TraceTemplate and WindowTraceTemplate, optional

second window trace template

start_trace_template: PCell and _TraceTemplate and WindowTraceTemplate, optional

first window trace template

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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
Parameters:

view_name: str, optional

The name of the view

width_step: float and number > 0, optional

discretisation in width for the parabolic shapes

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

length: float and Real, number and number >= 0, locked

length of the transition

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

Examples

import ipkiss3.all as i3
from ipkiss3.pcell.trace.window_trace import WindowTraceTemplate
from ipkiss3.pcell.trace.window.window import PathTraceWindow
from ipkiss.primitives.layer import Layer

# Windows
windows1 = [PathTraceWindow(layer=Layer(0), start_offset=0.6, end_offset=1.0),
           PathTraceWindow(layer=Layer(1), start_offset=-0.6, end_offset=-1.0),
           PathTraceWindow(layer=Layer(2), start_offset=-1.5, end_offset=1.5)
           ]
windows2 = [PathTraceWindow(layer=Layer(0), start_offset=0.2, end_offset=1.7),
           PathTraceWindow(layer=Layer(1), start_offset=-0.2, end_offset=-1.7),
           PathTraceWindow(layer=Layer(2), start_offset=-2.0, end_offset=2.0)
           ]

# Trace Templates
tt1 = WindowTraceTemplate(name="tt1")
tt1_layout = tt1.Layout(windows=windows1)
tt2 = WindowTraceTemplate(name="tt2")
tt2_layout = tt2.Layout(windows=windows2)

# parabolic transition
trans_par = i3.ParabolicWindowTraceTransition(start_trace_template=tt1,
                                              end_trace_template=tt2)
trans_par_lay = trans_par.Layout(start_position=(0.0,0.0),
                                 end_position=(5.0,2.0))

trans_par_lay.visualize()
../../_images/transition-2.png

Waveguide transitions

The photonic implementation of trace transitions are waveguide transitions, also called tapers or mode converters. Two main types are predefined:

class ipkiss3.all.LinearWindowWaveguideTransition(*args, **kwargs)

Linear waveguide transition (taper) for window waveguide templates

Parameters:

end_trace_template: PCell and _WaveguideTemplate, optional

second waveguide template

start_trace_template: PCell and _WaveguideTemplate, optional

first waveguide template

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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()
../../_images/transition-3.png

Views

Layout
Parameters:

view_name: str, optional

The name of the view

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

length: float and Real, number and number >= 0, locked

length of the transition

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

class ipkiss3.all.ParabolicWindowWaveguideTransition(*args, **kwargs)

Parabolic waveguide transition (taper) for window waveguide templates

Parameters:

end_trace_template: PCell and _WaveguideTemplate, optional

second waveguide template

start_trace_template: PCell and _WaveguideTemplate, optional

first waveguide template

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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()
../../_images/transition-4.png

Views

Layout
Parameters:

view_name: str, optional

The name of the view

width_step: float and number > 0, optional

discretisation in width for the parabolic shapes

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

length: float and Real, number and number >= 0, locked

length of the transition

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

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, optional

second waveguide template

start_trace_template: PCell and _WaveguideTemplate, optional

first waveguide template

start_port: _PortInterface, optional

the port on which to extract trace template, position and angle

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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()
../../_images/transition-5.png

Views

Layout
Parameters:

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

view_name: str, optional

The name of the view

length: float and Real, number and number >= 0, optional

length of the transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

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, optional

second waveguide template

start_trace_template: PCell and _WaveguideTemplate, optional

first waveguide template

start_port: _PortInterface, optional

the port on which to extract trace template, position and angle

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

reverse_templates: 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()
../../_images/transition-6.png

Views

Layout
Parameters:

straight_extension: Coord2, optional

tuple: straight extension at start and end of transition

view_name: str, optional

The name of the view

width_step: float and number > 0, optional

discretisation in width for the parabolic shapes

length: float and Real, number and number >= 0, optional

length of the transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

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
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_class : trace template class

trace template class (not object) at the beginning of the taper that must be accepted ast start_trace_template by the taper_class.

end_trace_template_class : trace 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_class : class

Taper class that creates the taper. It should be an instance of TraceTransitionFromPort, otherwise it cannot be instantiated correctly.

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_template : trace template

trace template at the beginning of the taper.

end_trace_template : trace 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.

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_template : trace 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:

external_port_names: optional

Dictionary for remapping of the port names of the contents to the external ports

transition_database: AutoTransitionDatabase, optional

AutoTransitionDatabase in which the correct transition between the two trace templates can be looked up.

start_port: _PortInterface, optional

the port on which to extract trace template, position and angle

end_trace_template: PCell and _TraceTemplate, optional

second trace template

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

contents: PCell, locked

transition that is generated by this class

start_trace_template: PCell and _TraceTemplate, locked

reverse_templates: 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

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()
../../_images/transition-7.png
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()
../../_images/transition-8.png

Views

Layout
Parameters:

contents_transformation: GenericNoDistortTransform, optional

flatten_contents: optional

if True, it will insert the contents as elements in the layout, rather than as an Instance

view_name: str, optional

The name of the view

zero_length_if_identical: optional

Uses a zero length transition if the trace templates are identical

length: float and Real, number and number >= 0, optional

length of the transition

end_position: Coord2, optional

end position of the transition

start_position: Coord2, optional

start position of the transition

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT