def test_ebeam_wg_integral_1550(tmpdir): """Tests whether the results of `s_parameters()` for the same frequency on an exported and reloaded model are (close) to the same.""" p = tmpdir.mkdir("persist").join("export") wg1 = ebeam_wg_integral_1550(100e-9) export_model(wg1, p, wl=np.linspace(1520e-9, 1580e-9, 51)) wg = import_model(p + ".mdl") wg2 = wg() freq = np.linspace(wl2freq(1540e-9), wl2freq(1560e-9), 50) assert np.allclose(wg1.s_parameters(freq), wg2.s_parameters(freq))
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))
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np from simphony.library import ebeam, sipann 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 = ebeam.ebeam_wg_integral_1550(100e-6) # A terminator for dispersing unused light term = ebeam.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 | | \ / \ / ---=====--- 1 3
def test_rename(self): wg = ebeam.ebeam_wg_integral_1550(50e-6)
import numpy as np from simphony.library import ebeam, sipann from simphony.netlist import Subcircuit from simphony.simulation import SweepSimulation from simphony.tools import freq2wl, wl2freq # We can rename the pins attribute on the class before we instantiate them; # then we don't have to rename the pins on each element individually later. ebeam.ebeam_wg_integral_1550.pins = ('in', 'out') sipann.sipann_dc_fifty.pins = ('in1', 'in2', 'out1', 'out2') sipann.sipann_dc_crossover1550.pins = ('in1', 'in2', 'out1', 'out2') # Get all the models we're going to need for the green machine circuit: gc = ebeam.ebeam_gc_te1550() wg100 = ebeam.ebeam_wg_integral_1550(length=100e-6) dc = sipann.sipann_dc_fifty() crossover = sipann.sipann_dc_crossover1550() wgin2 = ebeam.ebeam_wg_integral_1550(length=102.125e-6) wg300 = ebeam.ebeam_wg_integral_1550(length=300e-6) # Add all the elements used in the circuit circuit = Subcircuit('Green Machine') e = circuit.add([ # Define the four input grating couplers (gc, 'in1'), (gc, 'in2'), (gc, 'in3'), (gc, 'in4'), # The grating couplers each feed into their own waveguide