GaAs-AlAs Bragg Mirror

A simple bragg mirror in the near infrared. As a default, this notebook is setup to work with binder.

Importing libraries

Below we import the library python style, i.e. with the import Library syntax.


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

Dielectric Stack inputs

Below are all the input variables of the dielectric mirror. Play around with them and see what happens


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

Field computation and reference data loading

  • In the first cell we compute the dielectric stack reflectance using 1DPyHC, and convert the output to a numpy array;
  • In the second cell we import the reflectance spectra computed for the same system with py_matrix

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]

data plotting

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 [ ]: