Hi,
I was calculating the optical properties of an Anisotropic "BSb" material, i followed the "Si optical properties tutorial".
Where Si was taken as isotropic material, so while calculating refractive index and absorption coefficient only ϵxx tensor of the dielectric constant was considered. However, to perform a calculation of refractive index and absorption coefficient for an anisotropic material, all three ϵxx, ϵyy, ϵzz tensors of dielectric constant have to be considered.
Below is python script for reading ϵxx tesnor given in the tutorial. (Si optical properties tutorial can be found in the quantumwise site if necessary.)
My question is how to read all three dielectric tensors ϵxx, ϵyy, ϵzz for calculating the refractive index and absorption coefficient using the below code.
Thank you in advance.
# Load the optical spectrum
spectrum = nlread('Si.nc',OpticalSpectrum)[-1]
# Get the energies range
energies = spectrum.energies()
# get the real and imaginary part of the e_xx component of the dielectric tensor
d_r = spectrum.evaluateDielectricConstant()[0,0,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,0,:]
# Calculate the wavelength
l = (speed_of_light*planck_constant/energies).inUnitsOf(nanoMeter)
# Calculate real and complex part of the refractive index
n = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)+d_r))
k = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)-d_r))
# Calculate the adsorption coefficient
alpha = (2*energies/hbar/speed_of_light*k).inUnitsOf(nanoMeter**-1)
# Plot the data
import pylab
pylab.figure()
pylab.subplots_adjust(hspace=0.0)
ax = pylab.subplot(211)
ax.plot(l,n,'b', label='refractive index')
ax.axis([1,1000,0,4])
ax.set_ylabel(r"$n$", size=20)
ax.tick_params(axis='x', labelbottom=False, labeltop=True)
ax = pylab.subplot(212)
ax.plot(l,alpha,'r')
ax.axis([1,1000,0,0.4])
ax.set_xlabel(r"$\lambda$ (nm)", size=20)
ax.set_ylabel(r"$\alpha$ (1/nm)",size=20)
pylab.show()
Hello Anders Sir,
The problem still exists. I ran the code attached here but getting the below error.
+------------------------------------------------------------------------------+
| NanoLanguageScript execution started |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
| |
| Atomistix ToolKit 2014.0 [Build b2b9542] |
| |
+------------------------------------------------------------------------------+
C:\Program Files\QuantumWise\VNL-ATK-2014.0\bin\python27.zip\NL\CommonConcepts\PhysicalQuantity.py:474: RuntimeWarning: divide by zero encountered in divide
Timing: Total Per Step %
--------------------------------------------------------------------------------
File IO, nlread : 0.00 s 0.00 s 0.02% |=============|
--------------------------------------------------------------------------------
Total : 4.73 s
Traceback (most recent call last):
File "c:\users\vikash\appdata\local\temp\1246138492958026.py", line 27, in <module>
ax.plot(l,n,'b', label='refracive index')
File ".\build\lib\site-packages\matplotlib\axes.py", line 3996, in plot
File ".\build\lib\site-packages\matplotlib\axes.py", line 330, in _grab_next_args
File ".\build\lib\site-packages\matplotlib\axes.py", line 308, in _plot_args
File ".\build\lib\site-packages\matplotlib\axes.py", line 248, in _xy_from_xy
ValueError: x and y must have same first dimension
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished |
+------------------------------------------------------------------------------+
# Load the optical spectrum
spectrum = nlread('Lin-BAs.nc',OpticalSpectrum)[-1]
# Get the energies range
energies = spectrum.energies()
# get the real and imaginary part of the e_xx, e_yy, e_zz component of the dielectric tensor
d_r = spectrum.evaluateDielectricConstant()
d_i = spectrum.evaluateImaginaryDielectricConstant()
# Calculate the wavelength
l = (speed_of_light*planck_constant/energies).inUnitsOf(nanoMeter)
# Calculate real and complex part of the refractive index
n = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)+d_r))
k = numpy.sqrt(0.5*(numpy.sqrt(d_r**2+d_i**2)-d_r))
# Plot the data
import pylab
pylab.figure()
pylab.subplots_adjust(hspace=0.0)
ax = pylab.subplot(211)
ax.plot(l,n,'b', label='refracive index')
ax.axis([1,1000,0,5])
ax.set_xlabel(r"$\lambda$ (nm)", size=20)
ax.set_ylabel(r"$n$", size=20)
ax.tick_params(axis='x', labelbottom=False, labeltop=True)
ax = pylab.subplot(212)
ax.plot(energies,n,'r')
ax.axis([0,20,0,5])
ax.set_xlabel(r"$Energy$ (eV)", size=20)
ax.set_ylabel(r"$n$",size=20)
pylab.show()