def mzi_gc(L0=1, L1=100, L2=10, y_model_factory=mmi1x2): """ MZI with grating couplers Deprecated! use add_gc instead """ y = pp.call_if_func(y_model_factory) gc = siepic.ebeam_gc_te1550() wg_long = siepic.ebeam_wg_integral_1550(length=(2 * L0 + 2 * L1 + L2) * 1e-6) wg_short = siepic.ebeam_wg_integral_1550(length=(2 * L0 + L2) * 1e-6) # Create the circuit, add all individual instances circuit = Subcircuit("MZI") circuit.add([ (gc, "input"), (gc, "output"), (y, "splitter"), (y, "recombiner"), (wg_long, "wg_long"), (wg_short, "wg_short"), ]) # You can set pin names individually: circuit.elements["input"].pins["n2"] = "input" circuit.elements["output"].pins["n2"] = "output" # Or you can rename all the pins simultaneously: # circuit.elements["splitter"].pins = ("in1", "out1", "out2") # circuit.elements["recombiner"].pins = ("out1", "in2", "in1") # Circuits can be connected using the elements' string names: circuit.connect_many([ ("input", "n1", "splitter", "W0"), ("splitter", "E0", "wg_long", "n1"), ("splitter", "E1", "wg_short", "n1"), ("recombiner", "E0", "wg_long", "n2"), ("recombiner", "E1", "wg_short", "n2"), ("output", "n1", "recombiner", "W0"), ]) return circuit
def result_monte(): # Declare the models used in the circuit gc = siepic.ebeam_gc_te1550() y = siepic.ebeam_y_1550() wg150 = siepic.ebeam_wg_integral_1550(length=150e-6) wg50 = siepic.ebeam_wg_integral_1550(length=50e-6) # Create the circuit, add all individual instances circuit = Subcircuit("MZI") e = circuit.add([ (gc, "input"), (gc, "output"), (y, "splitter"), (y, "recombiner"), (wg150, "wg_long"), (wg50, "wg_short"), ]) # You can set pin names individually: circuit.elements["input"].pins["n2"] = "input" circuit.elements["output"].pins["n2"] = "output" # Or you can rename all the pins simultaneously: circuit.elements["splitter"].pins = ("in1", "out1", "out2") circuit.elements["recombiner"].pins = ("out1", "in2", "in1") # Circuits can be connected using the elements' string names: circuit.connect_many([ ("input", "n1", "splitter", "in1"), ("splitter", "out1", "wg_long", "n1"), ("splitter", "out2", "wg_short", "n1"), ("recombiner", "in1", "wg_long", "n2"), ("recombiner", "in2", "wg_short", "n2"), ("output", "n1", "recombiner", "out1"), ]) sim = MonteCarloSweepSimulation(circuit) return sim.simulate()
# # File: filters.py import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np from SiPANN import scee from SiPANN.scee_int import SimphonyWrapper from simphony.library import siepic from simphony.netlist import Subcircuit from simphony.simulation import SweepSimulation from simphony.tools import freq2wl # Have a main data line where frequency multiplexed data enters the circuit. wg_data = siepic.ebeam_wg_integral_1550(100e-6) # A terminator for dispersing unused light term = siepic.ebeam_terminator_te1550() def ring_factory(radius): """ Creates a full ring (with terminator) from a half ring. Ports of a half ring are ordered like so: 2 4 | | \ / \ / ---=====---
def test_ebeam_ebeam_wg_integral_1550(self): assert is_equal(siepic.ebeam_wg_integral_1550(100e-6), ebeam.ebeam_wg_integral_1550(100e-6))
def mzi(L0=1, L1=100, L2=10, y_model_factory=mmi1x2): """ Mzi Args: L0: vertical length for both and top arms L1: bottom arm extra length, delta_length = 2*L1 L2: L_top horizontal length .. code:: __L2__ | | L0 L0r | | splitter==| |==recombiner | | L0 L0r | | L1 L1 | | |__L2__| .. plot:: :include-source: import pp c = pp.c.mzi(L0=0.1, L1=0, L2=10) pp.plotgds(c) .. plot:: :include-source: import simphony.library.gdsfactory as cl c = cl.mzi() simulation = SweepSimulation(circuit, 1500e-9, 1600e-9) result = simulation.simulate() f, s = result.data("input", "output") plt.plot(f, s) plt.title("MZI") plt.tight_layout() plt.show() """ y = pp.call_if_func(y_model_factory) wg_long = siepic.ebeam_wg_integral_1550(length=(2 * L0 + 2 * L1 + L2) * 1e-6) wg_short = siepic.ebeam_wg_integral_1550(length=(2 * L0 + L2) * 1e-6) # Create the circuit, add all individual instances circuit = Subcircuit("mzi") circuit.add([ (y, "splitter"), (y, "recombiner"), (wg_long, "wg_long"), (wg_short, "wg_short"), ]) # Circuits can be connected using the elements' string names: circuit.connect_many([ ("splitter", "E0", "wg_long", "n1"), ("splitter", "E1", "wg_short", "n1"), ("recombiner", "E0", "wg_long", "n2"), ("recombiner", "E1", "wg_short", "n2"), ]) circuit.elements["splitter"].pins["W0"] = "input" circuit.elements["recombiner"].pins["W0"] = "output" return circuit
def mzi_circuit(L0=1, L1=100, L2=10): """ Mzi Args: L0: vertical length for both and top arms L1: bottom arm extra length L2: L_top horizontal length .. code:: __L2__ | | L0 L0r | | splitter==| |==recombiner | | L0 L0r | | L1 L1 | | |__L2__| .. plot:: :include-source: import pp c = pp.c.mzi(L0=0.1, L1=0, L2=10) pp.plotgds(c) """ gc = siepic.ebeam_gc_te1550() y = siepic.ebeam_y_1550() wg_long = siepic.ebeam_wg_integral_1550(length=(2 * L0 + +L1 + L2) * 1e-6) wg_short = siepic.ebeam_wg_integral_1550(length=(2 * L0 + L2) * 1e-6) # Create the circuit, add all individual instances circuit = Subcircuit("MZI") circuit.add([ (gc, "input"), (gc, "output"), (y, "splitter"), (y, "recombiner"), (wg_long, "wg_long"), (wg_short, "wg_short"), ]) # You can set pin names individually: circuit.elements["input"].pins["n2"] = "input" circuit.elements["output"].pins["n2"] = "output" # Or you can rename all the pins simultaneously: circuit.elements["splitter"].pins = ("in1", "out1", "out2") circuit.elements["recombiner"].pins = ("out1", "in2", "in1") # Circuits can be connected using the elements' string names: circuit.connect_many([ ("input", "n1", "splitter", "in1"), ("splitter", "out1", "wg_long", "n1"), ("splitter", "out2", "wg_short", "n1"), ("recombiner", "in1", "wg_long", "n2"), ("recombiner", "in2", "wg_short", "n2"), ("output", "n1", "recombiner", "out1"), ]) return circuit
# Licensed under the terms of the MIT License # (see simphony/__init__.py for details) # # File: mzi.py import matplotlib.pyplot as plt import numpy as np from simphony.library import siepic from simphony.netlist import Subcircuit from simphony.simulation import SweepSimulation, MonteCarloSweepSimulation # Declare the models used in the circuit gc = siepic.ebeam_gc_te1550() y = siepic.ebeam_y_1550() wg150 = siepic.ebeam_wg_integral_1550(length=150e-6) wg50 = siepic.ebeam_wg_integral_1550(length=50e-6) # Create the circuit, add all individual instances circuit = Subcircuit('MZI') e = circuit.add([ (gc, 'input'), (gc, 'output'), (y, 'splitter'), (y, 'recombiner'), (wg150, 'wg_long'), (wg50, 'wg_short'), ]) # You can set pin names individually: circuit.elements['input'].pins['n2'] = 'input'