案例分享:通过设定固定长度的波导来仿真波导的损耗:
如:
所有代码如下:
from si_fab import all as pdk
import numpy as np
from matplotlib import pyplot as plt
from picazzo3.wg.spirals import FixedLengthSpiralRounded
trace_templates = [pdk.SWG550(), pdk.SWG450()]
wls_oband = np.linspace(1.26, 1.36, 10001)
wls_cband = np.linspace(1.5, 1.6, 10001)
wls_bands = [wls_cband, wls_oband]
for trace_template, wls_band in zip(trace_templates, wls_bands):
spiral = FixedLengthSpiralRounded(total_length=10000, n_o_loops=6, trace_template=trace_template)
spiral.Layout(
incoupling_length=0.0,
bend_radius=50.0,
spacing=4,
stub_direction="V", # either H or V
growth_direction="H", # either H or V
)
spiral.Layout().visualize(annotate=True)
cm = spiral.CircuitModel()
S = cm.get_smatrix(wavelengths=wls_band)
transmission = 10 * np.log10(np.abs(S["out", "in"]) ** 2)
phase = np.unwrap(np.angle(S["out", "in"]))
plt.plot(wls_band, transmission, label="in -> out,\nLoss: {:.3g} dB/cm".format(np.mean(transmission)))
plt.xlabel("Wavelength [um]")
plt.ylabel("Transmission [dB] ")
plt.ylim([-0.5, 0])
plt.title(
"Trace_template: {}, Spiral length: {} cm".format(spiral.trace_template.name, spiral.total_length / 10000))
plt.tight_layout()
plt.legend(fontsize=14, loc=0)
plt.show()