<jupyter_start><jupyter_text>Get the Ports of Crossover<jupyter_code>dc = core.ComponentInstance(sipann.sipann_dc_crossover1550)
wg = core.ComponentInstance(dev.ebeam_wg_integral_1550)

c1 = [dc]
p1 = [1]
c2 = [wg]
p2 = [0]

con = zip(c1, p1, c2, p2)

nl = core.Netlist()
nl.load(con, formatter='ll')
simu = sim.Simulation(nl, num=30)

freq = simu.freq_array
sparams = simu.s_parameters()


plt.figure(figsize=(15,10))
plt.plot(freq, np.abs(sparams[:,0,1])**2, label='t')
plt.plot(freq, np.abs(sparams[:,0,2])**2, label='k')
c = 299792458
plt.axvline(c / 1550e-9, label='1550nm')
plt.legend(loc='upper right')
plt.show()<jupyter_output><empty_output><jupyter_text>Get the Through Port of a Racetrack Resonator using SiPANN and Simphony<jupyter_code>radius = 12
length = 4.5

bottom = core.ComponentInstance(sipann.sipann_dc_halfracetrack, extras=
                                {'radius': radius, 'length': length, 'gap': 0.3})

top    = core.ComponentInstance(sipann.sipann_dc_halfracetrack, extras=
                                {'radius': radius, 'length': length, 'gap': 0.3})

c1 = [bottom, bottom]
p1 = [1, 3]
c2 = [top, top]
p2 = [1, 3]

con = zip(c1, p1, c2, p2)

nl = core.Netlist()
nl.load(con, formatter='ll')
simu = sim.Simulation(nl)

freq = simu.freq_array
sparams = simu.s_parameters()


plt.figure(figsize=(15,10))
plt.plot(freq, np.abs(sparams[:,0,2]))
plt.show()<jupyter_output><empty_output><jupyter_text>Get the Ports of a 10/90 Optimized Directional CouplerNote: This one may take a while to run.<jupyter_code>with open('dc.pkl', 'rb') as handle:
    dic = dill.load(handle)

pts = dic['g']
zmin = 0
zmax = dic['w']
dic = bezier(pts, zmax)
gap = dic['f']
dgap = dic['df']


dc = core.ComponentInstance(sipann.sipann_dc_arbitrarysym, extras=
                            {'gap': gap, 'dgap': dgap, 'zmin': zmin, 'zmax': zmax})
wg = core.ComponentInstance(dev.ebeam_wg_integral_1550)

c1 = [dc]
p1 = [1]
c2 = [wg]
p2 = [0]

con = zip(c1, p1, c2, p2)

nl = core.Netlist()
nl.load(con, formatter='ll')
simu = sim.Simulation(nl, num=30)

freq = simu.freq_array
sparams = simu.s_parameters()


plt.figure(figsize=(15,10))
plt.plot(freq, np.abs(sparams[:,0,1])**2, label='t')
plt.plot(freq, np.abs(sparams[:,0,2])**2, label='k')
plt.legend(loc='upper right')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17796976241900647, 'fraction_numerical': 0.04535637149028078, 'mean_word_length': 4.60774818401937, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '538984', 'license': 'MIT', 'n_tokens_mistral': 1062, 'n_tokens_neox': 982, 'n_words': 192, 'path': 'examples/SiPANN/sipann.ipynb', 'repo_name': 'rspotc/simphony', 'size': '2315'}