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"

links: list and List with type restriction, allowed types: [<class ‘_abcoll.Sequence’>], optional

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

child_cells: optional

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

external_port_names: optional

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

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell


""" 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
from ipkiss3 import all as i3
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}

ring2 = RingRectNotchFilter()

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("Wavelength ($\mu m$)")
plt.ylabel("Power transmission")



grids_per_unit: optional

Number of grid cells per design unit

units_per_grid: optional

Ratio of grid cell and design unit

view_name: str, optional

The name of the view

grid: float and number > 0, optional

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

unit: float and number > 0, optional

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