Page 1 of 1
Problem in plotting dielectric function
Posted: Fri Mar 15, 2024 10:45 am
by atul_pandey
Dear Sir,
I am trying to calculate the frequency-dependent dielectric function (including the local field effect), but I am having problems plotting/extracting the results. I have compiled the hdf5 with vasp 6.4.1 and after completion of the calculation, vaspout.h5 file was obtained. After that, I installed py4vasp using the Anaconda prompt command. but using the command "calc.dielectric_function.plot()," an error is coming, and I am unable to plot the results. I have attached the screenshot below.
Please ...
Re: Problem in plotting dielectric function
Posted: Fri Mar 15, 2024 10:18 pm
by andreas.singraber
Hello!
I think you are missing one step when trying to run py4vasp commands: they must be run in a Python shell, not directly in your terminal. Ideally, to visualize data we recommend to use
Jupyter lab. First, change into the directory where your calculation results are stored. Then, execute in your terminal:
You should see your browser opening the startup screen of Jupyter lab:
jupyterlab.jpg
If this does not work, please check your installation of Jupyter lab (see e.g.
https://jupyter.org/install). Click on the button labelled "Python 3" in the category "Notebook" to open a new notebook where you can run py4vasp commands, e.g., like this:
jupyterlab2.jpg
I hope this works as well for you, please be sure to have a look at the
py4vasp documentation.
All the best,
Andreas Singraber
Re: Problem in plotting dielectric function
Posted: Sat Mar 16, 2024 8:26 am
by atul_pandey
Okay, sir, I will try and let you know. Is it necessary to install py4vasp in the Jupiter Note book? Where do I install Py4Vasp?
Re: Problem in plotting dielectric function
Posted: Mon Mar 18, 2024 8:04 am
by andreas.singraber
It should be sufficient to start Jupyter lab from your (base) shell where you have already installed py4vasp.
Re: Problem in plotting dielectric function
Posted: Wed Mar 20, 2024 11:55 am
by atul_pandey
I have installed py4vasp in anaconda prompt command.
Re: Problem in plotting dielectric function
Posted: Wed Mar 20, 2024 11:58 am
by atul_pandey
Where should I install py4vasp? in Anaconda prompt command or anywhere else?
I have installed phonopy in anaconda prompt command and all the command is working well there.
Re: Problem in plotting dielectric function
Posted: Wed Mar 20, 2024 8:29 pm
by andreas.singraber
Hello!
Looking at your screenshots it seems you have set up a conda environment with the name
py4vasp-env. If you enter the test command you already tried before so that it looks like this:
Code: Select all
(py4vasp-env) D:\Vasp\Ti3C2_Diek_DFT>python -c "import py4vasp; print(py4vasp.__version__)"
and you get
0.7.3 as result then py4vasp is correctly installed within the
py4vasp-env conda environment. Hence, if you start now Jupyter lab from this environment like this:
Code: Select all
(py4vasp-env) D:\Vasp\Ti3C2_Diek_DFT>jupyter lab
and start a new notebook then you should be able to use py4vasp there.
Best,
Andreas Singraber
Re: Problem in plotting dielectric function
Posted: Thu Mar 21, 2024 5:41 pm
by atul_pandey
Respected Sir,
Thankyou for your response and guidance,
I have tried and plotted the graph, which is attached below.
According to the VASP Wiki, frequency dependent dielectric can be calculated by three method 1. Independent particle 2. Including local field effect (Hartree) and 3 Including local field effect (DFTT USING LRPA = .FALSE.).
I have plotted the independent particle result, using py4vasp, but in outcar of independent particle picture, two types of dielectric obtained, one is density density and 2nd one is cuurrent current.
can you tell me, which one is plotted using py4vasp?
Re: Problem in plotting dielectric function
Posted: Thu Mar 21, 2024 6:00 pm
by atul_pandey
hi sir, My second question is , after calculating dielectric by independent particle approximation, I have used LRPA = .FALSE. Including the local field effect (DFT)).
After completion of the calculation, the result was obtained as mentioned in the Vaspwiki. But, when am i trying to plot the result in notbook using py4vasp error is coming. I have attached the problem below.
Please let me know which method we should try.
Independent particle method?
LOCAL FIELD EFFECT (RPA)
LOCAL FIELD EFFECT (DFT)?
Re: Problem in plotting dielectric function
Posted: Fri Mar 22, 2024 10:02 am
by andreas.singraber
Hello!
Regarding your first reply: the plot shows the
density-density data set as you can see from the label "density" in the figure. You should be able to get the
current-current plot by using the
selection argument to the plot:
Code: Select all
calc.dielectric_function.plot(selection="current")
Please let me know if that does not work!
Concerning your second question: I think you have to use "dielectric_
tensor" instead of "dielectric_function" here, e.g.,
However, there is no method to plot the tensor.
Best,
Andreas Singraber
Re: Problem in plotting dielectric function
Posted: Wed Mar 27, 2024 4:51 pm
by atul_pandey
Okay, sir, thanks for your suggestions. I will let you know.
Re: Problem in plotting dielectric function
Posted: Thu Mar 28, 2024 12:49 pm
by atul_pandey
Dear Sir,
calc.dielectric_tensor.read()
this is not working.
I have attached the error below.