def mzi4(freqs): y1 = siepic.YBranch() gc1 = siepic.GratingCoupler() wg1 = siepic.Waveguide(length=67.730e-6) wg2 = siepic.Waveguide(length=297.394e-6) y2 = siepic.YBranch() gc2 = siepic.GratingCoupler() wg3 = siepic.Waveguide(length=256.152e-6) simulator = SweepSimulator(freqs[0], freqs[-1], len(freqs)) y1.rename_pins("N$0", "N$2", "N$1") gc1.rename_pins("ebeam_gc_te1550_detector2", "N$0") wg1.rename_pins("N$1", "N$4") wg2.rename_pins("N$2", "N$5") y2.rename_pins("N$6", "N$5", "N$4") gc2.rename_pins("ebeam_gc_te1550_laser1", "N$3") wg3.rename_pins("N$6", "N$3") y1.multiconnect(gc1["N$0"], wg2, wg1) y2.multiconnect(wg3, wg2, wg1) wg3.connect(gc2["N$3"]) simulator.multiconnect(gc2, gc1) return simulator.circuit
def mzi(): gc_input = siepic.GratingCoupler() y_splitter = siepic.YBranch() wg_long = siepic.Waveguide(length=150e-6) wg_short = siepic.Waveguide(length=50e-6) y_recombiner = siepic.YBranch() gc_output = siepic.GratingCoupler() y_splitter.multiconnect(gc_input, wg_long, wg_short) y_recombiner.multiconnect(gc_output, wg_short, wg_long) return y_splitter.circuit
def test_caching(self, mzi, sweep): _, gc_input, _, _, _, gc_output = mzi sweep.multiconnect(gc_input, gc_output) # after simulating, the circuit should be cached sweep.simulate() assert sweep.circuit in sweep.__class__.scache # connecting the simulator to different points should retain the cache sweep.disconnect() sweep.multiconnect(gc_output, gc_input) assert sweep.circuit in sweep.__class__.scache # if the circuit changes, it shouldn't be cached anymore sweep.disconnect() wg_med = siepic.Waveguide(length=100e-6) wg_med.connect(gc_output) sweep.multiconnect(gc_input, wg_med) assert sweep.circuit not in sweep.__class__.scache # of course, after simulation it should then be cached again sweep.simulate() assert sweep.circuit in sweep.__class__.scache
ring1 = ring_factory(10e-6) simulator = SweepSimulator(1500e-9, 1600e-9) simulator.multiconnect(ring1["in"], ring1["pass"]) f, t = simulator.simulate(mode="freq") plt.plot(f, t) plt.title("10-micron Ring Resonator") plt.tight_layout() plt.show() simulator.disconnect() # Now, we'll create the circuit (using several ring resonator subcircuits) # instantiate the basic components wg_input = siepic.Waveguide(100e-6) wg_out1 = siepic.Waveguide(100e-6) wg_connect1 = siepic.Waveguide(100e-6) wg_out2 = siepic.Waveguide(100e-6) wg_connect2 = siepic.Waveguide(100e-6) wg_out3 = siepic.Waveguide(100e-6) terminator = siepic.Terminator() # instantiate the rings with varying radii ring1 = ring_factory(10e-6) ring2 = ring_factory(11e-6) ring3 = ring_factory(12e-6) # connect the circuit together ring1.multiconnect(wg_connect1, wg_input["pin2"], wg_out1) ring2.multiconnect(wg_connect2, wg_connect1, wg_out2)
import numpy as np from simphony.libraries import siepic, sipann from simphony.simulators import SweepSimulator from simphony.tools import freq2wl, wl2freq # Get all the components that we're going to need for the green machine circuit: in1 = siepic.GratingCoupler(name="in1") in2 = siepic.GratingCoupler(name="in2") in3 = siepic.GratingCoupler(name="in3") in4 = siepic.GratingCoupler(name="in4") out1 = siepic.GratingCoupler(name="out1") out2 = siepic.GratingCoupler(name="out2") out3 = siepic.GratingCoupler(name="out3") out4 = siepic.GratingCoupler(name="out4") wg1 = siepic.Waveguide(length=100e-6, name="wg1") wg2 = siepic.Waveguide(length=100e-6, name="wg2") wg3 = siepic.Waveguide(length=100e-6, name="wg3") wg4 = siepic.Waveguide(length=100e-6, name="wg4") wg5 = siepic.Waveguide(length=100e-6, name="wg5") wg6 = siepic.Waveguide(length=100e-6, name="wg6") wg7 = siepic.Waveguide(length=100e-6, name="wg7") wg8 = siepic.Waveguide(length=100e-6, name="wg8") wg_in1 = siepic.Waveguide(length=100e-6, name="wg_in1") wg_in2 = siepic.Waveguide(length=100e-6, name="wg_in2") dc1 = sipann.PremadeCoupler(50, name="dc1") dc2 = sipann.PremadeCoupler(50, name="dc2") dc3 = sipann.PremadeCoupler(50, name="dc3") dc4 = sipann.PremadeCoupler(50, name="dc4") crossing = sipann.PremadeCoupler(100, name="crossing") wg_out1 = siepic.Waveguide(length=102.125e-6, name="wg_out1")
def waveguide(): return siepic.Waveguide(length=150e-6)
def wg3(): return siepic.Waveguide(50e-6)
def wg2(): return siepic.Waveguide(100e-6)
def wg1(): return siepic.Waveguide(150e-6)
# Copyright © Simphony Project Contributors # Licensed under the terms of the MIT License # (see simphony/__init__.py for details) import matplotlib.pyplot as plt from simphony.libraries import siepic from simphony.simulators import MonteCarloSweepSimulator, SweepSimulator # first we initialize all of the components in the MZI circuit gc_input = siepic.GratingCoupler() y_splitter = siepic.YBranch() wg_long = siepic.Waveguide(length=150e-6) wg_short = siepic.Waveguide(length=50e-6) y_recombiner = siepic.YBranch() gc_output = siepic.GratingCoupler() # next we connect the components to each other # you can connect pins directly: y_splitter["pin1"].connect(gc_input["pin1"]) # or connect components with components: # (when using components to make connections, their first unconnected pin will # be used to make the connection.) y_splitter.connect(wg_long) # or any combination of the two: y_splitter["pin3"].connect(wg_short) # y_splitter.connect(wg_short["pin1"]) # when making multiple connections, it is often simpler to use `multiconnect`