Problem in plotting dielectric function

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Locked
Message
Author
atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Problem in plotting dielectric function

#1 Post by atul_pandey » Fri Mar 15, 2024 10:45 am

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 ...
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Problem in plotting dielectric function

#2 Post by andreas.singraber » Fri Mar 15, 2024 10:18 pm

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:

Code: Select all

jupyter lab
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
You do not have the required permissions to view the files attached to this post.

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#3 Post by atul_pandey » Sat Mar 16, 2024 8:26 am

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?

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Problem in plotting dielectric function

#4 Post by andreas.singraber » Mon Mar 18, 2024 8:04 am

It should be sufficient to start Jupyter lab from your (base) shell where you have already installed py4vasp.

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#5 Post by atul_pandey » Wed Mar 20, 2024 11:55 am

I have installed py4vasp in anaconda prompt command.

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#6 Post by atul_pandey » Wed Mar 20, 2024 11:58 am

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.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Problem in plotting dielectric function

#7 Post by andreas.singraber » Wed Mar 20, 2024 8:29 pm

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

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#8 Post by atul_pandey » Thu Mar 21, 2024 5:41 pm

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?
You do not have the required permissions to view the files attached to this post.

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#9 Post by atul_pandey » Thu Mar 21, 2024 6:00 pm

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)?
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Problem in plotting dielectric function

#10 Post by andreas.singraber » Fri Mar 22, 2024 10:02 am

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.,

Code: Select all

calc.dielectric_tensor.read()
However, there is no method to plot the tensor.

Best,
Andreas Singraber

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#11 Post by atul_pandey » Wed Mar 27, 2024 4:51 pm

Okay, sir, thanks for your suggestions. I will let you know.

atul_pandey
Newbie
Newbie
Posts: 17
Joined: Thu May 18, 2023 5:47 am

Re: Problem in plotting dielectric function

#12 Post by atul_pandey » Thu Mar 28, 2024 12:49 pm

Dear Sir,

calc.dielectric_tensor.read()
this is not working.
I have attached the error below.
You do not have the required permissions to view the files attached to this post.

Locked