Problem in plotting dielectric function
Moderators: Global Moderator, Moderator
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Problem in plotting dielectric function
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 ...
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.
-
- Global Moderator
- Posts: 236
- Joined: Mon Apr 26, 2021 7:40 am
Re: Problem in plotting dielectric function
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:
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:
I hope this works as well for you, please be sure to have a look at the py4vasp documentation.
All the best,
Andreas Singraber
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
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:
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.
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
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?
-
- Global Moderator
- Posts: 236
- Joined: Mon Apr 26, 2021 7:40 am
Re: Problem in plotting dielectric function
It should be sufficient to start Jupyter lab from your (base) shell where you have already installed py4vasp.
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
I have installed py4vasp in anaconda prompt command.
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
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.
I have installed phonopy in anaconda prompt command and all the command is working well there.
-
- Global Moderator
- Posts: 236
- Joined: Mon Apr 26, 2021 7:40 am
Re: Problem in plotting dielectric function
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:
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:
and start a new notebook then you should be able to use py4vasp there.
Best,
Andreas Singraber
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__)"
Code: Select all
(py4vasp-env) D:\Vasp\Ti3C2_Diek_DFT>jupyter lab
Best,
Andreas Singraber
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
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?
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.
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
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)?
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.
-
- Global Moderator
- Posts: 236
- Joined: Mon Apr 26, 2021 7:40 am
Re: Problem in plotting dielectric function
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:
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
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")
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()
Best,
Andreas Singraber
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
Okay, sir, thanks for your suggestions. I will let you know.
-
- Newbie
- Posts: 17
- Joined: Thu May 18, 2023 5:47 am
Re: Problem in plotting dielectric function
Dear Sir,
calc.dielectric_tensor.read()
this is not working.
I have attached the error below.
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.