Different velocity information py4vasp vs outpu

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


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
burakgurlek
Jr. Member
Jr. Member
Posts: 51
Joined: Thu Apr 06, 2023 12:25 pm

Different velocity information py4vasp vs outpu

#1 Post by burakgurlek » Mon Jul 31, 2023 4:52 pm

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

alexey.tal
Global Moderator
Global Moderator
Posts: 314
Joined: Mon Sep 13, 2021 12:45 pm

Re: Different velocity information py4vasp vs outpu

#2 Post by alexey.tal » Tue Aug 01, 2023 9:33 am

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.

burakgurlek
Jr. Member
Jr. Member
Posts: 51
Joined: Thu Apr 06, 2023 12:25 pm

Re: Different velocity information py4vasp vs outpu

#3 Post by burakgurlek » Tue Aug 01, 2023 9:41 am

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

alexey.tal
Global Moderator
Global Moderator
Posts: 314
Joined: Mon Sep 13, 2021 12:45 pm

Re: Different velocity information py4vasp vs outpu

#4 Post by alexey.tal » Tue Aug 01, 2023 9:46 am

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.

burakgurlek
Jr. Member
Jr. Member
Posts: 51
Joined: Thu Apr 06, 2023 12:25 pm

Re: Different velocity information py4vasp vs outpu

#5 Post by burakgurlek » Tue Aug 01, 2023 9:50 am

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

alexey.tal
Global Moderator
Global Moderator
Posts: 314
Joined: Mon Sep 13, 2021 12:45 pm

Re: Different velocity information py4vasp vs outpu

#6 Post by alexey.tal » Tue Aug 01, 2023 10:31 am

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()

burakgurlek
Jr. Member
Jr. Member
Posts: 51
Joined: Thu Apr 06, 2023 12:25 pm

Re: Different velocity information py4vasp vs outpu

#7 Post by burakgurlek » Tue Aug 01, 2023 12:56 pm

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

alexey.tal
Global Moderator
Global Moderator
Posts: 314
Joined: Mon Sep 13, 2021 12:45 pm

Re: Different velocity information py4vasp vs outpu

#8 Post by alexey.tal » Tue Aug 01, 2023 1:17 pm

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.

burakgurlek
Jr. Member
Jr. Member
Posts: 51
Joined: Thu Apr 06, 2023 12:25 pm

Re: Different velocity information py4vasp vs outpu

#9 Post by burakgurlek » Tue Aug 01, 2023 2:22 pm

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,

alexey.tal
Global Moderator
Global Moderator
Posts: 314
Joined: Mon Sep 13, 2021 12:45 pm

Re: Different velocity information py4vasp vs outpu

#10 Post by alexey.tal » Tue Aug 01, 2023 3:45 pm

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.

Post Reply