QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Shan on October 14, 2014, 09:22

Title: optical properties of Anisotropic material
Post by: Shan on October 14, 2014, 09:22
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.


Code
# 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()
Title: Re: optical properties of Anisotropic material
Post by: Anders Blom on October 15, 2014, 21:41
spectrum.evaluateDielectricConstant() is the full tensor.
spectrum.evaluateDielectricConstant()[0][0] is xx, spectrum.evaluateDielectricConstant()[0][1] would be xy, etc.
Title: Re: optical properties of Anisotropic material
Post by: Shan on October 16, 2014, 09:36
  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                                        |
+------------------------------------------------------------------------------+


Code
# 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()
Title: Re: optical properties of Anisotropic material
Post by: Anders Blom on October 16, 2014, 23:08
Yes the code is incorrect. The original version did e_xx by extracting [0][0] from the tensor. Now you extract no component. You need

d_r = spectrum.evaluateDielectricConstant()[0,1,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,1,:]

for e_xy, etc.
Title: Re: optical properties of Anisotropic material
Post by: Shan on October 17, 2014, 12:35
Hello Anders Sir,

Thank you very much for your reply, But i still have the problem.

for xx tensor,
d_r = spectrum.evaluateDielectricConstant()[0,0,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,0,:]

for xy tensor,
d_r = spectrum.evaluateDielectricConstant()[0,1,:]
d_i = spectrum.evaluateImaginaryDielectricConstant()[0,1,:]

...

What should be in the brackets for yy and zz tesors. (These two are the tensors i wanted to read)



                     Thank you in advance.


Title: Re: optical properties of Anisotropic material
Post by: Anders Blom on October 17, 2014, 13:23
x=0
y=1
z=2
Title: Re: optical properties of Anisotropic material
Post by: Shan on October 17, 2014, 15:49
 [0,1,2]

is for what?

for  yy or for zz.

needed clarity. if it is for yy then what is for zz.

Kindly present it in a straight forward manner.

Thank you.
Title: Re: optical properties of Anisotropic material
Post by: Shan on October 18, 2014, 11:42
Hello Anders Sir.........
Title: Re: optical properties of Anisotropic material
Post by: Shan on October 20, 2014, 07:53
Yes.. got it.

code is working now.

Thank  you.