A simple bragg mirror in the near infrared. As a default, this notebook is setup to work with binder.
In [ ]:
# importing libraries
import numpy as np # numpy
import matplotlib.pyplot as plt # matplotlib pyplot
import sys # sys to add py_matrix to the path
# adding folder containing 1DPyHC to path: by default is the folder for running in binder
sys.path.append('/home/main/notebooks')
import pyhc as phc # importing 1DPyHC
# useful parameters
f_size=20;
# inline plot magic
%matplotlib inline
In [ ]:
# ref indexes
n2 = 3.49 # GaAs
n1 = 2.95 # AlAs
n_inc = 1.0 # Incidend medium
n_sub = 1.45 # Substrate
# wavelength
wl = 1064
v_wl = np.linspace(950,1200,100)
# thickness
b = wl/(4 * n2)
a = wl/(4 * n1)
# stacks
N=20
In [ ]:
# 1dphc computation
v_R = np.array([phc.rN(b, a, n2, n1, n_inc, n_sub, N, phc.f_omega(l), 0.0) for l in v_wl])
In [ ]:
# reference t-matrix loading
ref_data = np.loadtxt('gaas_alas_tmatrix.spt')
v_wl_ref = ref_data[:,0]
v_R_ref = ref_data[:,1]
Here we plot the data using matplotlib and pyplot. If you want to create new plots with different stack parameters, it's better to remove the first row in the plot command, therefore removing the reference plot.
In [ ]:
# result plot
plt.figure(figsize=(12,10))
plt.plot(v_wl_ref,v_R_ref,'k',
v_wl,v_R,'ro',linewidth=2.0)
# ticks and labels
plt.xticks(fontsize=f_size)
plt.yticks(fontsize=f_size)
plt.xlabel("Wavelength (nm)", fontsize=f_size)
plt.ylabel("R", fontsize=f_size)
# legend
plt.legend(('tmatrix reference','1DPyHC'),frameon=False,fontsize=f_size-5,loc='lower center')
In [ ]: