ConnectComponents

class picazzo3.routing.place_route.cell.ConnectComponents(*args, **kwargs)

Parametric Cell for logically connecting multiple components.

The user supplies a dictionary of the instances of child cells that need to be placed through the property child_cells. This dictionary maps the instance names to the PCell objects. The same PCell object can be used for multiple instances.

child_cells={ "ring1"  : my_ring1,
              "ring2"  : my_ring2,
              "spl"    : my_splitter,
              "com"    : my_splitter # the same cell is used both for splitting and combining
              }

The connectivity between the instances of the child cells is set by a list of tuples containing pairs of instance terms/port names. This list links is of the form instname:portname

links=[ ("spl:arm1",   "arm1:in1"),
        ("arm1:out1", "com:arm1"),
        ("spl:arm2",   "arm2:in1"),
        ("arm2:out1", "com:arm2")
        ]

All the terms of the instances are connected to outside terms. You can override the default external term names using the external_port_names property. There you can specify the individual names of the external terms. If no name is specified, the default pattern of ‘instname_termname’ will be used.

external_port_names={ "spl:in1"  : "input",
                      "com:out1" : "output"
                      }
Parameters
links: list and List with type restriction, allowed types: [<class ‘collections.abc.Sequence’>]

list of tuples connecting the instances. Format is [(‘inst1:term1’,’inst2:term2’), …]

child_cells:

dict to create the instances of the child cells.Format is {‘inst_name1’: PCell}

external_port_names: str

Map of the free instance terms/ports to the names of external terms/ports.Format is a dict {‘inst:term’ : ‘new_term_name’}.If a term/port is not listed, the format instname_portname will be used

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

The unique name of the pcell

Examples

"""Here we connect 2 splitters and two rings into a RLMZI
We use the splitter twice but use two different rings.
"""
from technologies import silicon_photonics  # noqa: F401
from ipkiss3 import all as i3  # noqa: F401
import numpy as np
import pylab as plt

from picazzo3.filters.ring import RingRectNotchFilter
from picazzo3.wg.splitters import WgY90Splitter

from picazzo3.routing.place_route import ConnectComponents

ring1 = RingRectNotchFilter()
cp = {"cross_coupling1": 0.4j, "straight_coupling1": (1 - 0.4**2) ** 0.5}
ring1.CircuitModel(coupler_parameters=[cp], ring_length=50.0)

ring2 = RingRectNotchFilter()
ring2.CircuitModel(coupler_parameters=[cp], ring_length=55.0)

splitter = WgY90Splitter()

pc = ConnectComponents(
    child_cells={"spl": splitter, "com": splitter, "arm1": ring1, "arm2": ring2},
    links=[
        ("spl:arm1", "arm1:in"),
        ("arm1:out", "com:arm1"),
        ("spl:arm2", "arm2:in"),
        ("arm2:out", "com:arm2"),
    ],
)

cm = pc.CircuitModel()

# Caphe simulation
wavelengths = np.linspace(1.50, 1.6, 2001)
R = cm.get_smatrix(wavelengths=wavelengths)

plt.plot(wavelengths, np.abs(R["spl_center", "com_center"]) ** 2, "b", label="power")
plt.title("Waveguide transmission (Power)")
plt.xlabel(r"Wavelength ($\mu m$)")
plt.ylabel("Power transmission")
plt.legend()
plt.show()
../../../../_images/picazzo3-routing-place_route-cell-ConnectComponents-1.png

Views

Layout = <class 'ipkiss3.pcell.container.connect_components.ConnectComponents.Layout'>