Different velocity information py4vasp vs outpu
Moderators: Global Moderator, Moderator
-
- Jr. Member
- Posts: 51
- Joined: Thu Apr 06, 2023 12:25 pm
Different velocity information py4vasp vs outpu
Hi,
I am trying to read velocities via py4vasp. I use the flag VELOCITY=T in INCAR file.
When I compare the velocities obtained from py4vasp and .xml file they differ. This is also true for velocities in the CONTCAR file. Are the units ofthose different or cartesian vs direct ? or Am I missing a point? I would appriciate the help.
Regards,
Burak
I am trying to read velocities via py4vasp. I use the flag VELOCITY=T in INCAR file.
When I compare the velocities obtained from py4vasp and .xml file they differ. This is also true for velocities in the CONTCAR file. Are the units ofthose different or cartesian vs direct ? or Am I missing a point? I would appriciate the help.
Regards,
Burak
-
- Global Moderator
- Posts: 314
- Joined: Mon Sep 13, 2021 12:45 pm
Re: Different velocity information py4vasp vs outpu
Dear Burak,
Correct, the velocities in vasprun.xml are given in direct coordinates. However, in the CONTCAR and vaspout.h5 files, the velocities are represented in Cartesian coordinates.
Correct, the velocities in vasprun.xml are given in direct coordinates. However, in the CONTCAR and vaspout.h5 files, the velocities are represented in Cartesian coordinates.
-
- Jr. Member
- Posts: 51
- Joined: Thu Apr 06, 2023 12:25 pm
Re: Different velocity information py4vasp vs outpu
Dear Alexey,
Thanks, however, in vasp 6.4.2 it seems the CONTCAR file also has direct coordinates. My problem is that CONTCAR, vasp.xml and vaspout.h5(py4vasp -1 slice) has different postions and velocity data. I am a bit puzzelled. Any idea?
Regards,
Burak
Thanks, however, in vasp 6.4.2 it seems the CONTCAR file also has direct coordinates. My problem is that CONTCAR, vasp.xml and vaspout.h5(py4vasp -1 slice) has different postions and velocity data. I am a bit puzzelled. Any idea?
Regards,
Burak
-
- Global Moderator
- Posts: 314
- Joined: Mon Sep 13, 2021 12:45 pm
Re: Different velocity information py4vasp vs outpu
Let me have a look at your files. Could you please provide all relevant input and output files for your calculation according to the forum guidelines.
-
- Jr. Member
- Posts: 51
- Joined: Thu Apr 06, 2023 12:25 pm
Re: Different velocity information py4vasp vs outpu
Dear Alexey,
you can reach files from https://www.dropbox.com/scl/fo/9gamlbra ... lkk8v&dl=0
it also seems that py4vasp does velocity rescaling (py4vasp/latest/data/velocity/#py4vasp.d ... ty_rescale), but I could not figure out how it works.
Thanks
you can reach files from https://www.dropbox.com/scl/fo/9gamlbra ... lkk8v&dl=0
it also seems that py4vasp does velocity rescaling (py4vasp/latest/data/velocity/#py4vasp.d ... ty_rescale), but I could not figure out how it works.
Thanks
-
- Global Moderator
- Posts: 314
- Joined: Mon Sep 13, 2021 12:45 pm
Re: Different velocity information py4vasp vs outpu
Actually, I see that the velocities in your vaspout.h5 and CONTCAR are the same. Could it be something in your python script that performs rescaling? If I run this code, I get the same velocities as in CONTCAR.
Code: Select all
from py4vasp import Calculation
calc = Calculation.from_path(".")
calc.velocity[-1].read()
-
- Jr. Member
- Posts: 51
- Joined: Thu Apr 06, 2023 12:25 pm
Re: Different velocity information py4vasp vs outpu
Interesting! This is what I see from the py4vasp code (first three lines)
-0.00332693 -0.00275901 -0.00514225
0.00254728 -0.0111068 0.00614215
-0.00509531 5.80632e-05 0.00221705
This is what I see from CONTCAR file
-0.73006317E-03 -0.74797904E-03 -0.11889150E-02
-0.26207275E-02 0.68284580E-03 -0.24962973E-02
0.40995753E-02 0.49126433E-03 0.12660755E-02
Am I be looking to something different? I do not rescale the velocity except using the code piece you wrote
-0.00332693 -0.00275901 -0.00514225
0.00254728 -0.0111068 0.00614215
-0.00509531 5.80632e-05 0.00221705
This is what I see from CONTCAR file
-0.73006317E-03 -0.74797904E-03 -0.11889150E-02
-0.26207275E-02 0.68284580E-03 -0.24962973E-02
0.40995753E-02 0.49126433E-03 0.12660755E-02
Am I be looking to something different? I do not rescale the velocity except using the code piece you wrote
-
- Global Moderator
- Posts: 314
- Joined: Mon Sep 13, 2021 12:45 pm
Re: Different velocity information py4vasp vs outpu
I opened your vaspout.h5 file directly with h5dump (h5dump -d /results/positions/ion_velocities vaspout.h5) and the velocities perfectly match the ones from CONTCAR. Is it possible that the vaspout.h5 file that you read via py4vasp is different from the one you uploaded to the dropbox folder? Also, the velocities that you provided for the first three atoms from py4vasp and CONTCAR have different signs, which indicates that it is not a scaling issue.
-
- Jr. Member
- Posts: 51
- Joined: Thu Apr 06, 2023 12:25 pm
Re: Different velocity information py4vasp vs outpu
Dear Alexey,
many thanks, I was somehow looking into the different file. I have one more relatex question: If I read the positions and velocities and use to create a POSCAR file just stating the coordinates are Cartesian also valid for velocities?
Do you know why in py4vasp there is a thing for velocity rescaling (py4vasp/latest/data/velocity/#py4vasp.d ... ty_rescale)? Does py4vasp rescales or not?
Additionally, you wrote in the begining that the CONTCAR and vaspout.h5 are Cartesian coordinates, but it seems direct as I see from the CONTCAR file and from calc.structure[-1].to_POSCAR(). Is that correct?
Regards,
many thanks, I was somehow looking into the different file. I have one more relatex question: If I read the positions and velocities and use to create a POSCAR file just stating the coordinates are Cartesian also valid for velocities?
Do you know why in py4vasp there is a thing for velocity rescaling (py4vasp/latest/data/velocity/#py4vasp.d ... ty_rescale)? Does py4vasp rescales or not?
Additionally, you wrote in the begining that the CONTCAR and vaspout.h5 are Cartesian coordinates, but it seems direct as I see from the CONTCAR file and from calc.structure[-1].to_POSCAR(). Is that correct?
Regards,
-
- Global Moderator
- Posts: 314
- Joined: Mon Sep 13, 2021 12:45 pm
Re: Different velocity information py4vasp vs outpu
If the line before velocities is empty, the velocities are assumed in Cartesian coordinates (see POSCAR).
py4vasp uses velocity_rescale to rescale vectors when velocities are plotted.
py4vasp uses velocity_rescale to rescale vectors when velocities are plotted.