Transitions

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

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

class ipkiss3.pcell.trace.transitions.linear.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.

Layout

alias of LinearWindowTraceTransition.Layout

Netlist

alias of LinearWindowTraceTransition.Netlist

class ipkiss3.pcell.trace.transitions.parabolic.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.

Layout

alias of ParabolicWindowTraceTransition.Layout

Netlist

alias of ParabolicWindowTraceTransition.Netlist

Waveguide transitions

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

class ipkiss3.pcell.photonics.transitions.linear.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-1.png
CircuitModel

alias of LinearWindowWaveguideTransition.CircuitModel

Layout

alias of LinearWindowWaveguideTransition.Layout

Netlist

alias of LinearWindowWaveguideTransition.Netlist

SimpleCapheModel

alias of LinearWindowWaveguideTransition.SimpleCapheModel

SimpleCircuitModel

alias of LinearWindowWaveguideTransition.SimpleCircuitModel

class ipkiss3.pcell.photonics.transitions.parabolic.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-2.png
CircuitModel

alias of ParabolicWindowWaveguideTransition.CircuitModel

Layout

alias of ParabolicWindowWaveguideTransition.Layout

Netlist

alias of ParabolicWindowWaveguideTransition.Netlist

SimpleCapheModel

alias of ParabolicWindowWaveguideTransition.SimpleCapheModel

SimpleCircuitModel

alias of ParabolicWindowWaveguideTransition.SimpleCircuitModel

Waveguide transitions starting from a port

Transitions from a port start from a port of PCell. Given a length, they calculate their own properties, using the trace template, position and angle given by the start port.

class ipkiss3.pcell.photonics.transitions.linear.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-3.png
CircuitModel

alias of LinearWindowWaveguideTransitionFromPort.CircuitModel

Layout

alias of LinearWindowWaveguideTransitionFromPort.Layout

Netlist

alias of LinearWindowWaveguideTransitionFromPort.Netlist

SimpleCapheModel

alias of LinearWindowWaveguideTransitionFromPort.SimpleCapheModel

SimpleCircuitModel

alias of LinearWindowWaveguideTransitionFromPort.SimpleCircuitModel

class ipkiss3.pcell.photonics.transitions.parabolic.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-4.png
CircuitModel

alias of ParabolicWindowWaveguideTransitionFromPort.CircuitModel

Layout

alias of ParabolicWindowWaveguideTransitionFromPort.Layout

Netlist

alias of ParabolicWindowWaveguideTransitionFromPort.Netlist

SimpleCapheModel

alias of ParabolicWindowWaveguideTransitionFromPort.SimpleCapheModel

SimpleCircuitModel

alias of ParabolicWindowWaveguideTransitionFromPort.SimpleCircuitModel

AutoTraceTransitionFromPort

AutoTraceTransitions work with a AutoTransitionDatabase that links combinations of trace templates with a transition class used to connect them.

class ipkiss3.pcell.trace.transitions.auto_transition.auto_transition_db.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.pcell.trace.transitions.auto_transition.auto_trace_transition.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
from picazzo3.traces.rib_wg import RibWaveguideTemplate
from picazzo3.traces.wire_wg import WireWaveguideTemplate
from picazzo3.traces.slot_wg import SlotWaveguideTemplate
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-5.png
from technologies import silicon_photonics
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),
                                    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-6.png
CapheModel

alias of AutoTraceTransitionFromPort.CapheModel

CircuitModel

alias of AutoTraceTransitionFromPort.CircuitModel

Layout

alias of AutoTraceTransitionFromPort.Layout

Netlist

alias of AutoTraceTransitionFromPort.Netlist