TerminatePorts

class picazzo3.container.terminate_ports.TerminatePorts

Wraps a PCell in a container and terminates the ports specified by the user. If None is given for the port_labels, all ports will be suppressed.

You can also provide another PCell to the property ‘termination’ which will be attached to each terminated port (a stub, to remove reflections). If None is provided, a logical termination is added to the Netlist, but no termination is added in the layout.

Parameters:
termination_external_port_name_map: str

dict to map the names of the termination ports that are exposed as external ports. The format is { ‘port_name_on_termination’ : ‘new_name_{port}’ }. The ‘{port}’ in the map will be replaced by the corresponding port name on the component.For instance, when you use grating couplers or detectors as terminations, this map allows you to map the name of the vertical port or the electrical ports to the name of the terminated port on the contents. Similarly, you can use {inst} to insert the name of the instance of the termination. By default, the behavior is ‘{inst}_{port}’.

termination_port_label: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters

label of the port on the termination that will be used to connect to the part of the contents. Default is ‘in’

termination: PCell

cell which will be used to terminate the ports

trace_template: ( PCell and _WaveguideTemplate ), *None allowed*

Template for all ports, defaults to TECH.PCELLS.WG.DEFAULT.When set to None, the waveguide templates of the ports will be used.

termination_instance_prefix: String that contains only alphanumeric characters from the ASCII set or contains _$. ASCII set is extended on PY3.

Prefix for the instance names of the terminations. Default is taken from TECH.CONTAINER.TERMINATE_PORTS

auto_transition: ( bool, bool_ or int )

If True, automatically transition all ports of contents to the given trace template. If False, no transitions are applied, which might lead to a discontinuity in the waveguide. Also, if trace_template is None, no transitions are applied.

port_labels: ( List with type restriction, allowed types: <class ‘str’> ), *None allowed*

Labels of the ports to be processed. Set to None to process all ports.

external_port_names: str

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

contents: PCell

the contents of the container: the child cell

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:
termination_external_port_name_maps: locked
termination_port_labels: locked
terminations: List with type restriction, allowed types: <class ‘ipkiss3.pcell.cell.pcell.PCell’>, locked
trace_templates: List with type restriction, allowed types: <class ‘ipkiss3.pcell.cell.pcell.PCell’>, locked

list of templates to apply to all ports

Examples

"""Layout example of terminated ring resonator"""
import si_fab.all as pdk  # noqa: F401
from picazzo3.filters.ring import RingRect180DropFilter

my_ring = RingRect180DropFilter()
my_ring.Layout()
from picazzo3.container.terminate_ports import TerminatePorts

# Optionally we can add a structure where the ports are suppressed
from picazzo3.apertures.basic import WireWgAperture
from picazzo3.traces.wire_wg import WireWaveguideTemplate

wire_t = WireWaveguideTemplate()
wire_t.Layout(core_width=2.0, cladding_width=6.0)
my_termination = WireWgAperture(name="my_termination", aperture_trace_template=wire_t)
my_termination.Layout(transition_length=4.0)
my_ring_terminated = TerminatePorts(contents=my_ring, port_labels=["E1"], termination=my_termination)
my_ring_terminated_layout = my_ring_terminated.Layout()
my_ring_terminated_layout.visualize(annotate=True)
../../../../../_images/picazzo3-container-terminate_ports-TerminatePorts-1.png
"""Simulation example of terminated ring resonator"""
import si_fab.all as pdk  # noqa: F401
import numpy as np
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.terminate_ports import TerminatePorts
from picazzo3.logical.termination import Termination
import pylab as plt

my_ring = RingRect180DropFilter()

cp = {
    "cross_coupling1": 1j * 0.05**0.5,  # The coupling from bus to ring and back
    "straight_coupling1": 0.95**0.5,  # Straight coupling
}

my_ring.CircuitModel(ring_length=2 * np.pi * 10.0, coupler_parameters=[cp, cp])

my_termination = Termination()
my_termination.CircuitModel(reflection=0.5**0.5)
my_ring_terminated = TerminatePorts(contents=my_ring, port_labels=["W1"], termination=my_termination)
my_ring_terminated.Netlist()
my_ring_terminated_cm = my_ring_terminated.CircuitModel()

wavelengths = np.linspace(1.535, 1.55, 800)
R = my_ring_terminated_cm.get_smatrix(wavelengths=wavelengths)

plt.figure()
plt.plot(wavelengths, 10 * np.log10(abs(R["in1", "in1"] ** 2)), "r-", label="reflection in1")
plt.plot(wavelengths, 10 * np.log10(abs(R["in1", "out1", :] ** 2)), "b-", label="in port to pass port (out1)")
plt.plot(wavelengths, 10 * np.log10(abs(R["in1", "in2", :] ** 2)), "g-", label="in port to add port (in2)")
plt.xlim([wavelengths[0], wavelengths[-1]])
plt.legend()
plt.show()
../../../../../_images/picazzo3-container-terminate_ports-TerminatePorts-2.png

Views

class Layout
Parameters:
termination_transformations: List with type restriction, allowed types: <class ‘ipkiss.geometry.transforms.no_distort.NoDistortTransform’>

Transformations of the terminations. By default, these are calculated to match the ports of the contents.

contents_transformation: GenericNoDistortTransform

transformation to apply to the contents

flatten_contents: ( bool, bool_ or int )

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

view_name: String that contains only alphanumeric characters from the ASCII set or contains _$. ASCII set is extended on PY3.

The name of the view