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()
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
def test_ebeam_y_1550(self): assert is_equal(siepic.ebeam_y_1550(), ebeam.ebeam_y_1550())
# Copyright © Simphony Project Contributors # 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: