Plotting dielectric function
Moderators: Global Moderator, Moderator
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Plotting dielectric function
is there any tool to extract frequency dependent dielectric constant in all xx yy zz direction?
awk 'BEGIN{i=1} /imag/,\
/\/imag/ \
{a=$2 ; b=$3 ; i=i+1} \
END{for (j=12;j<i-3;j++) print a[j],b[j]}' vasprun.xml > imag.dat
awk 'BEGIN{i=1} /real/,\
/\/real/ \
{a=$2 ; b=$3 ; i=i+1} \
END{for (j=12;j<i-3;j++) print a[j],b[j]}' vasprun.xml > real.dat
cat >plotfile<<!
# set term postscript enhanced eps colour lw 2 "Helvetica" 20
# set output "optics.eps"
plot [0:25] "imag.dat" using (\$1):(\$2) w lp, "real.dat" using (\$1):(\$2) w lp
!
gnuplot -persist plotfile
I used this script to extract but got only xx direction data. Is there any post processing tool available to extrat data in all direction easily?
awk 'BEGIN{i=1} /imag/,\
/\/imag/ \
{a=$2 ; b=$3 ; i=i+1} \
END{for (j=12;j<i-3;j++) print a[j],b[j]}' vasprun.xml > imag.dat
awk 'BEGIN{i=1} /real/,\
/\/real/ \
{a=$2 ; b=$3 ; i=i+1} \
END{for (j=12;j<i-3;j++) print a[j],b[j]}' vasprun.xml > real.dat
cat >plotfile<<!
# set term postscript enhanced eps colour lw 2 "Helvetica" 20
# set output "optics.eps"
plot [0:25] "imag.dat" using (\$1):(\$2) w lp, "real.dat" using (\$1):(\$2) w lp
!
gnuplot -persist plotfile
I used this script to extract but got only xx direction data. Is there any post processing tool available to extrat data in all direction easily?
-
- Global Moderator
- Posts: 215
- Joined: Fri Jul 01, 2022 2:17 pm
Re: Plotting dielectric function
Dear atul_pandey,
Regarding your question. We have a tool to plot the dielectric function. You can use py4vasp
for this purpose. For installation check the following page:
https://www.vasp.at/py4vasp/latest/#installation
From vasp 6.3 on you can do GW,BSE... calculations and compute the frequency dependent dielectric function with the LOPTICS tag. With py4vasp you can plot the function under the use of the command
For information to the LOPTICS tag check here
https://www.vasp.at/wiki/index.php/LOPTICS
You can find guidelines for basic usage of py4vasp here
https://www.vasp.at/py4vasp/latest/#quick-start
I hope this is of help.
All the best Jonathan
Regarding your question. We have a tool to plot the dielectric function. You can use py4vasp
for this purpose. For installation check the following page:
https://www.vasp.at/py4vasp/latest/#installation
From vasp 6.3 on you can do GW,BSE... calculations and compute the frequency dependent dielectric function with the LOPTICS tag. With py4vasp you can plot the function under the use of the command
Code: Select all
calc.dielectric_function.plot()
https://www.vasp.at/wiki/index.php/LOPTICS
You can find guidelines for basic usage of py4vasp here
https://www.vasp.at/py4vasp/latest/#quick-start
I hope this is of help.
All the best Jonathan
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
okay sir thanks
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
Respected sir,
I have installed py4vasp in my anaconda prompt command, I think I have not installed vasp6.3 with h5 in hpc thats why I am not getting vaspout.h5 file. I have tried to plot in anaconda prompt bit failed, can you help me sir in plottind data. Because have calculated frequency dependent dielectric funcions including loacal field effect with dft and got this.
INVERSE MACROSCOPIC DIELECTRIC TENSOR (test charge-test charge, local field effects in DFT)
-------------------------------------
w= 0.000 0.000
3.9879 -0.0083 0.0000 -0.0000 -0.0000 0.0000
0.0000 0.0000 3.9627 0.0173 0.0000 0.0000
-0.0000 -0.0000 0.0000 -0.0000 1.4263 -0.0099
0.000 3.126 -0.000 dielectric constant
w= 0.764 0.000
3.8691 0.7186 0.0000 -0.0000 -0.0000 -0.0000
-0.0000 0.0000 3.8559 0.7835 0.0000 0.0000
-0.0000 -0.0000 0.0000 0.0000 1.4241 0.0111
0.764 3.050 0.504 dielectric constant
w= 1.527 0.000
3.1370 1.4510 0.0000 0.0000 -0.0000 -0.0000
-0.0000 -0.0000 3.1467 1.4166 0.0000 0.0000
-0.0000 -0.0000 0.0000 0.0000 1.4169 0.0053
1.527 2.567 0.958 dielectric constant
w= 2.289 0.000
2.5582 1.1361 0.0000 0.0000 -0.0000 -0.0000
-0.0000 -0.0000 2.6959 1.1322 0.0000 -0.0000
-0.0000 -0.0000 0.0000 -0.0000 1.4131 0.0254
2.289 2.222 0.765 dielectric constant
.
.
.
etc
I am confused how to plot, and which one is correct dielectric constant, why am I not getting in all three directions in above like previous one using loptics=.True.( Independent particle picture method). How to plot this data in all three axis. Please help me sir
I have installed py4vasp in my anaconda prompt command, I think I have not installed vasp6.3 with h5 in hpc thats why I am not getting vaspout.h5 file. I have tried to plot in anaconda prompt bit failed, can you help me sir in plottind data. Because have calculated frequency dependent dielectric funcions including loacal field effect with dft and got this.
INVERSE MACROSCOPIC DIELECTRIC TENSOR (test charge-test charge, local field effects in DFT)
-------------------------------------
w= 0.000 0.000
3.9879 -0.0083 0.0000 -0.0000 -0.0000 0.0000
0.0000 0.0000 3.9627 0.0173 0.0000 0.0000
-0.0000 -0.0000 0.0000 -0.0000 1.4263 -0.0099
0.000 3.126 -0.000 dielectric constant
w= 0.764 0.000
3.8691 0.7186 0.0000 -0.0000 -0.0000 -0.0000
-0.0000 0.0000 3.8559 0.7835 0.0000 0.0000
-0.0000 -0.0000 0.0000 0.0000 1.4241 0.0111
0.764 3.050 0.504 dielectric constant
w= 1.527 0.000
3.1370 1.4510 0.0000 0.0000 -0.0000 -0.0000
-0.0000 -0.0000 3.1467 1.4166 0.0000 0.0000
-0.0000 -0.0000 0.0000 0.0000 1.4169 0.0053
1.527 2.567 0.958 dielectric constant
w= 2.289 0.000
2.5582 1.1361 0.0000 0.0000 -0.0000 -0.0000
-0.0000 -0.0000 2.6959 1.1322 0.0000 -0.0000
-0.0000 -0.0000 0.0000 -0.0000 1.4131 0.0254
2.289 2.222 0.765 dielectric constant
.
.
.
etc
I am confused how to plot, and which one is correct dielectric constant, why am I not getting in all three directions in above like previous one using loptics=.True.( Independent particle picture method). How to plot this data in all three axis. Please help me sir
-
- Global Moderator
- Posts: 215
- Joined: Fri Jul 01, 2022 2:17 pm
Re: Plotting dielectric function
Dear atul_pandey,
Since py4vasp is a good tool for the evaluations your planning to do I would recommend to compile vasp with hd5 support.
You can do this by commenting in the following lines in your makefile.include
Regarding your output: What you see is as you say INVERSE MACROSCOPIC DIELECTRIC TENSOR.
What you get is a 3x3 tensor with components as follows
Because the dielectric tensor is frequency dependent you get this complex 3x3 tensor for every omega w.
Maybe it can be of help for you to check the vasp tutorials about dielectric properties. You can find them on this
page: wiki/index.php/Dielectric_properties_of_SiC
You will also find awk scripts there to plot you tensorial quantities.
I hope this is of help.
All the best Jonathan
Since py4vasp is a good tool for the evaluations your planning to do I would recommend to compile vasp with hd5 support.
You can do this by commenting in the following lines in your makefile.include
Code: Select all
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT ?= /path/to/your/hdf5/installation
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS += -I$(HDF5_ROOT)/include
What you get is a 3x3 tensor with components as follows
Code: Select all
real xx imag xx real xy imag xy real xz imag xz
real yx imag yx real yy imag yy real yz imag yz
real zx imag zx real zy imag zy real zz imag zz
Maybe it can be of help for you to check the vasp tutorials about dielectric properties. You can find them on this
page: wiki/index.php/Dielectric_properties_of_SiC
You will also find awk scripts there to plot you tensorial quantities.
I hope this is of help.
All the best Jonathan
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
thankyou sir for your valuable response.
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
After mentioning this "CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT ?= /path/to/your/hdf5/installation
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS += -I$(HDF5_ROOT)/include"
My calculations are not running.
I have attached the screenshot of makefile.include
HDF5_ROOT ?= /path/to/your/hdf5/installation
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS += -I$(HDF5_ROOT)/include"
My calculations are not running.
I have attached the screenshot of makefile.include
You do not have the required permissions to view the files attached to this post.
-
- Global Moderator
- Posts: 215
- Joined: Fri Jul 01, 2022 2:17 pm
Re: Plotting dielectric function
Dear atul_pandey,
Why are your calculations not running? What error message do you get?
Could you upload your OUTCAR and slurm_output file and your input files according
to the forum guidelines forum/viewtopic.php?f=4&t=17928
All the best Jonathan
Why are your calculations not running? What error message do you get?
Could you upload your OUTCAR and slurm_output file and your input files according
to the forum guidelines forum/viewtopic.php?f=4&t=17928
All the best Jonathan
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
I am getting this error.
You do not have the required permissions to view the files attached to this post.
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
Dear Sir,
after commenting this "CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT ?= /path/to/your/hdf5/installation
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS += -I$(HDF5_ROOT)/include" in cmake.include file
calculations are not going into queue in hpc, and I am getting this error "loading the modules required !!"
I have attached the error and slurm file below.
after commenting this "CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT ?= /path/to/your/hdf5/installation
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS += -I$(HDF5_ROOT)/include" in cmake.include file
calculations are not going into queue in hpc, and I am getting this error "loading the modules required !!"
I have attached the error and slurm file below.
You do not have the required permissions to view the files attached to this post.
-
- Global Moderator
- Posts: 215
- Joined: Fri Jul 01, 2022 2:17 pm
Re: Plotting dielectric function
Dear atul_pandey,
According to the files you sent it looks like you are missing the hdf5 modules.
When compiling vasp with the hdf5 support you have to load the hdf5 modules during compilation.
You also have to load the used libraries in the job file. Right now you are not loading
the hdf5 modules.
Another thing I recognized is your are loading intel compilers and some gnu libraries in your job script. According
to the makefile.include you sent, you are using an intel build. So it should be okay to only load the intel libraries.
And hence you also have to load the hdf5 modules built with intel during compilation and in your job script.
In the output file you supplied, I don't see an error message. Does the job script terminate after your echo statement without writing anything?
All the best Jonathan
According to the files you sent it looks like you are missing the hdf5 modules.
When compiling vasp with the hdf5 support you have to load the hdf5 modules during compilation.
You also have to load the used libraries in the job file. Right now you are not loading
the hdf5 modules.
Another thing I recognized is your are loading intel compilers and some gnu libraries in your job script. According
to the makefile.include you sent, you are using an intel build. So it should be okay to only load the intel libraries.
And hence you also have to load the hdf5 modules built with intel during compilation and in your job script.
In the output file you supplied, I don't see an error message. Does the job script terminate after your echo statement without writing anything?
All the best Jonathan
-
- Newbie
- Posts: 19
- Joined: Thu May 18, 2023 5:47 am
Re: Plotting dielectric function
Dear Sir,
In job.err file i am getting this.
In job.err file i am getting this.
You do not have the required permissions to view the files attached to this post.
-
- Global Moderator
- Posts: 215
- Joined: Fri Jul 01, 2022 2:17 pm
Re: Plotting dielectric function
Dear atul pandey,
As expected already in my last post, you don't load the hdf5 library before executing your job.
During compilation of vasp you have to load the hdf5 library otherwise you would not be able to compile.
When executing your job you have to load the same hdf5 library again.
The error message tells, you that the program is not able to find the dynamically linked hdf5 library which should be in the file libhdf5_fortran.so.
So you have to put a line
in your job script.
If you compiled the code yourself just load the same hdf5 modules which you used during compilation.
If you did not, the best would be to ask your system admin which libraries where used during compilation and which ones you should load.
And the last approach would be to do
This should show you a path where libhdf5_fortran.so can be found.
In your job script you have to export this path as
But the preferred way is to do this with a module load command in your job script.
All the best Jonathan
As expected already in my last post, you don't load the hdf5 library before executing your job.
During compilation of vasp you have to load the hdf5 library otherwise you would not be able to compile.
When executing your job you have to load the same hdf5 library again.
The error message tells, you that the program is not able to find the dynamically linked hdf5 library which should be in the file libhdf5_fortran.so.
So you have to put a line
Code: Select all
module load "name of you hdf5 library"
If you compiled the code yourself just load the same hdf5 modules which you used during compilation.
If you did not, the best would be to ask your system admin which libraries where used during compilation and which ones you should load.
And the last approach would be to do
Code: Select all
ldd /home/atulp.iitpr/vasp_6.4.1/bin/vasp_std
In your job script you have to export this path as
Code: Select all
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path to the file libhdf5_fortran.so/
All the best Jonathan
-
- Full Member
- Posts: 191
- Joined: Tue Oct 13, 2020 11:32 pm
Re: Plotting dielectric function
See here for the related discussion.