Example #1
0
        if self.parity==1:
            self.portlist["input_top"] = {'port':self.port, 'direction':tk.flip_direction(self.direction)}
            self.portlist["input_bot"] = {'port':self.portlist_input_cross, 'direction':tk.flip_direction(self.direction)}
            self.portlist["output_top"] = {'port':self.portlist_output_straight, 'direction':self.direction}
            self.portlist["output_bot"] = {'port':self.portlist_output_cross, 'direction':self.direction}
        elif self.parity==-1:
            self.portlist["input_top"] = {'port':self.portlist_input_cross, 'direction':tk.flip_direction(self.direction)}
            self.portlist["input_bot"] = {'port':self.port, 'direction':tk.flip_direction(self.direction)}
            self.portlist["output_top"] = {'port':self.portlist_output_cross, 'direction':self.direction}
            self.portlist["output_bot"] = {'port':self.portlist_output_straight, 'direction':self.direction}

if __name__ == "__main__":
    from . import *
    from picwriter.components.waveguide import WaveguideTemplate
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(wg_width=2.0, bend_radius=50, resist='+')

    # wg1=Waveguide([(0,0), (0, 20)], wgt)
    # tk.add(top, wg1)

    contradc_wgt = WaveguideTemplate(bend_radius=50, resist='+', wg_layer=3, wg_datatype=0)

    # cdc = ContraDirectionalCoupler(wgt, length=30.0, gap=1.0, period=0.5, dc=0.5, angle=np.pi/12.0, width_top=3.0, width_bot=2.0, input_bot=True, **wg1.portlist["output"])
    # tk.add(top, cdc)

    # wg1=Waveguide([(0,0), (0,100), (50,200), (50, 215)], wgt)
    wg1=Waveguide([(0,0), (100,0)], wgt)
    tk.add(top, wg1)

    cdc2 = ContraDirectionalCoupler(wgt, length=30.0, gap=1.0, period=0.5, dc=0.5, angle=np.pi/12.0, width_top=3.0, width_bot=2.0, dw_top=0.4, dw_bot=0.2, input_bot=False, contradc_wgt=contradc_wgt, fins=True, **wg1.portlist["output"])
    tk.add(top, cdc2)
Example #2
0
    def __build_ports(self):
        # Portlist format:
        #    example:  {'port':(x_position, y_position), 'direction': 'NORTH'}

        self.portlist["input"] = {"port": self.portlist_input, "direction": "WEST"}
        self.portlist["output"] = {"port": self.portlist_output, "direction": "EAST"}


if __name__ == "__main__":
    from picwriter.components.waveguide import WaveguideTemplate

    gdspy.current_library = gdspy.GdsLibrary()
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(
        bend_radius=50, wg_width=1.0, clad_width=10.0, euler_bend=True
    )

    sp1 = Spiral(
        wgt,
        width=2700.0,
        length=2900.0,
        spacing=20.0,
        parity=1,
        port=(0, 0),
        direction="EAST",
    )
    tk.add(top, sp1)

    print("length is " + str(sp1.get_spiral_length()))
    print("portlist = " + str(sp1.portlist))
Example #3
0
        if self.parity==1:
            self.portlist["input_top"] = {'port':self.port, 'direction':tk.flip_direction(self.direction)}
            self.portlist["input_bot"] = {'port':self.portlist_input_cross, 'direction':tk.flip_direction(self.direction)}
            self.portlist["output_top"] = {'port':self.portlist_output_straight, 'direction':self.direction}
            self.portlist["output_bot"] = {'port':self.portlist_output_cross, 'direction':self.direction}
        elif self.parity==-1:
            self.portlist["input_top"] = {'port':self.portlist_input_cross, 'direction':tk.flip_direction(self.direction)}
            self.portlist["input_bot"] = {'port':self.port, 'direction':tk.flip_direction(self.direction)}
            self.portlist["output_top"] = {'port':self.portlist_output_cross, 'direction':self.direction}
            self.portlist["output_bot"] = {'port':self.portlist_output_straight, 'direction':self.direction}

if __name__ == "__main__":
    from . import *
    from picwriter.components.waveguide import WaveguideTemplate
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(bend_radius=100, resist='+')

    wg1=Waveguide([(0,0), (100,0)], wgt)
    tk.add(top, wg1)

    dc = DirectionalCoupler(wgt, 20.0, 0.5, angle=np.pi/12.0, parity=1, **wg1.portlist["output"])
    tk.add(top, dc)

    # dc1 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=1, **wg1.portlist["output"])
    # dc2 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=-1, **dc1.portlist["output_top"])
    # dc3 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=1, **dc1.portlist["output_bot"])
    # dc4 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=1, **dc2.portlist["output_bot"])
    # dc5 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=-1, **dc2.portlist["output_top"])
    # dc6 = DirectionalCoupler(wgt, 10.0, 0.5, angle=np.pi/6.0, parity=1, **dc3.portlist["output_bot"])
    # tk.add(top, dc1)
    # tk.add(top, dc2)
Example #4
0
            self.portlist["output_top"] = {
                "port": self.portlist_output_cross,
                "direction": "EAST",
            }
            self.portlist["output_bot"] = {
                "port": self.portlist_output_straight,
                "direction": "EAST",
            }


if __name__ == "__main__":
    from . import *
    from picwriter.components.waveguide import WaveguideTemplate

    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(wg_width=2.0, bend_radius=100, resist="+")

    wg1 = Waveguide([(0, 0), (100, 40)], wgt)
    tk.add(top, wg1)

    fc = FullCoupler(wgt,
                     40.0,
                     0.5,
                     1.0,
                     angle=np.pi / 12.0,
                     parity=1,
                     **wg1.portlist["output"])
    tk.add(top, fc)
    for p in fc.portlist.keys():
        print(str(p) + ": " + str(fc.portlist[p]["port"]))
Example #5
0
    def build_ports(self):
        # Portlist format:
        #    example:  {'port':(x_position, y_position), 'direction': 'NORTH'}

        self.portlist["input"] = {
            'port': self.port,
            'direction': tk.flip_direction(self.direction)
        }
        self.portlist["output"] = {
            'port': self.portlist_output,
            'direction': self.direction
        }


if __name__ == "__main__":
    from picwriter.components.waveguide import WaveguideTemplate
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(bend_radius=50, resist='-')

    sp1 = Spiral(wgt,
                 500.0,
                 1000.0,
                 10000.0,
                 port=(100, 200),
                 direction=np.pi / 4.0)
    tk.add(top, sp1)

    gdspy.LayoutViewer()
    # gdspy.write_gds('spiral.gds', unit=1.0e-6, precision=1.0e-9)
Example #6
0
    def build_ports(self):
        # Portlist format:
        #    example:  {'port':(x_position, y_position), 'direction': 'NORTH'}

        self.portlist["input"] = {'port':self.port,
                                    'direction':tk.flip_direction(self.direction)}
        self.portlist["output"] = {'port':self.portlist_output,
                                    'direction':self.direction}

if __name__ == "__main__":
    from picwriter.components.waveguide import WaveguideTemplate
    gdspy.current_library = gdspy.GdsLibrary()
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(bend_radius=50,
                            wg_width=1.0,
                            clad_width=10.0)

    sp1 = Spiral(wgt,
                 width=300.0,
                 length=20000.0,
                 spacing=50.0,
                 parity=1,
                 port=(0,0),
                 direction='WEST')
    tk.add(top, sp1)

    print("length is "+str(sp1.get_spiral_length()))
    print("portlist = "+str(sp1.portlist))

    gdspy.LayoutViewer()
Example #7
0
            clad_path.rotate(-np.pi/2.0, self.port)
        elif isinstance(self.direction, float):
            teeth.rotate(self.direction - np.pi/2.0, self.port)
            path.rotate(self.direction -np.pi/2.0, self.port)
            clad_path.rotate(self.direction-np.pi/2.0, self.port)
        self.add(teeth)
        self.add(path)
        self.add(clad_path)

    def build_ports(self):
        # Portlist format:
        #    example:  {'port':(x_position, y_position), 'direction': 'NORTH'}
        self.portlist["output"] = {'port':self.port, 'direction':tk.flip_direction(self.direction)}

if __name__ == "__main__":
    from picwriter.components.waveguide import Waveguide, WaveguideTemplate
    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(bend_radius=50, resist='+', fab='ETCH')

    wg1=Waveguide([(0,0), (250,0), (250,500), (500,500)], wgt)
    tk.add(top, wg1)

    gc1 = GratingCouplerStraight(wgt, width=20, length=50, taper_length=20, period=1.0, dutycycle=0.7, **wg1.portlist["output"])
    tk.add(top, gc1)

    gc2 = GratingCouplerFocusing(wgt, focus_distance=20.0, width=20, length=50, period=1.0, dutycycle=0.7, **wg1.portlist["input"])
    tk.add(top,gc2)

    gdspy.LayoutViewer()
    # gdspy.write_gds('gratingcoupler.gds', unit=1.0e-6, precision=1.0e-9)
Example #8
0
        self.add(teeth)
        self.add(path)
        self.add(clad_path)

    def __build_ports(self):
        # Portlist format:
        #    example:  {'port':(x_position, y_position), 'direction': 'NORTH'}
        self.portlist["output"] = {"port": (0, 0), "direction": "WEST"}


if __name__ == "__main__":
    from picwriter.components.waveguide import Waveguide, WaveguideTemplate

    top = gdspy.Cell("top")
    wgt = WaveguideTemplate(bend_radius=50,
                            wg_width=0.5,
                            resist="+",
                            fab="ETCH")

    wg1 = Waveguide([(0, 0), (250, 0), (250, 500), (500, 500)], wgt)
    tk.add(top, wg1)

    gc1 = GratingCoupler(wgt,
                         theta=np.pi / 5.0,
                         length=40.0,
                         taper_length=20.0,
                         period=1.0,
                         dutycycle=0.6,
                         ridge=True,
                         **wg1.portlist["output"])
    tk.add(top, gc1)