Page 1 of 1

O2 Molecule Bond Length Result is Incorrect

Posted: Fri Nov 15, 2024 2:42 am
by chulho_lee

Dear VASP developers,

Hello, I am a graduate student new to VASP.
I am working through the tutorial, specifically on the "Bond length of the O2 molecule" section.

This tutorial is about finding the stable bond length of an oxygen molecule.
As shown in the POSCAR below, one oxygen atom is set at the origin, and the other is 1.22 Å along the z-axis.

POSCAR

Code: Select all

O2 molecule in a box
 1.0          ! universal scaling parameters
 8.0 0.0 0.0  ! lattice vector  a(1)
 0.0 8.0 0.0  ! lattice vector  a(2)
 0.0 0.0 8.0  ! lattice vector  a(3)
2             ! number of atoms
cart          ! positions in cartesian coordinates
 0 0 0        ! first atom
 0 0 1.22     ! second atom:

The INCAR setup I used is below

INCAR

Code: Select all

 SYSTEM = O2 dimer in a box
 ISMEAR = 0 ! Gaussian smearing
 ISPIN  = 2 ! spin-polarized calculation
 NSW    = 5 ! 5 ionic steps
 IBRION = 2 ! use the conjugate-gradient algorithm

This should find the best bond length. But, when I ran the simulation, I got strange results.

My Results:

Code: Select all

O2
1.0000000000000000
8.0000000000000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 8.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 8.0000000000000000
O
2
Direct
0.0000000000000000 0.0000000000000000 0.9990878682898270
0.0000000000000000 0.0000000000000000 0.1534121317101765

The second oxygen atom's position looks correct at about 1.224 Å.
But the first oxygen atom has moved from 0 Å to 8 Å, which seems incorrect.

This gives a bond length of 8 Å - 1.224 Å = 6.776 Å, which is much longer than expected.

The tutorial solution shows the first oxygen atom should be near the origin:

Tutorial Solution:

Code: Select all

O2
1.0
8.0000000000000000    0.0000000000000000    0.0000000000000000
0.0000000000000000    8.0000000000000000    0.0000000000000000
0.0000000000000000    0.0000000000000000    8.0000000000000000
O
2
Direct
0.0000000000000000    0.0000000000000000   -0.0009121317112740
0.0000000000000000    0.0000000000000000    0.1534121317112774

I don’t know what went wrong.
I followed the tutorial files exactly.
I searched the VASP forum to see if anyone else had experienced the same problem, but I couldn’t find anything.

I am attaching my INPUT and OUTPUT files.
Could you please help?

Thank you


Re: O2 Molecule Bond Length Result is Incorrect

Posted: Sun Nov 17, 2024 9:43 pm
by leszek_nowakowski

Hello,

The POSCAR that You've shown has a cartesian coordinates, which is fine. But VASP always outputs in direct coordinates, e.g. in internal basis vectors coordinates.
Direct (also called fractional or internal) coordinates scales from 0 to 1, when 0 is the origin of the grid, and 1 is the opposite side.
Further reading of fractional coordinates: https://en.wikipedia.org/wiki/Fractional_coordinates
Also, please read the POSCAR wiki: https://www.vasp.at/wiki/index.php/POSCAR

So, in Your example, You have one oxygen atom almost it the center (0.999 is very close to 1, and 1 in fractional coordinates is the same as 0), and another one is 0.15..*8 A above, which is exactly 1.227 A, so the result is correct.

Be careful! If Your unit cell is not parallelopipe, it is not so easy to transfer to cartesian coordinates, it needs some basic algebra.


Re: O2 Molecule Bond Length Result is Incorrect

Posted: Sun Nov 17, 2024 11:47 pm
by xin_zhao

VASP uses periodic boundary conditions when doing calculation. Under these conditions, atoms that differ by an integer number of lattice periodic coordinates are identical. For example, the positions specified by the fractional coordinates (0,0,0.9) and (0,0,-0.1) are identical. When calculating the spacing between atoms, especially those at the lattice boundaries, you need to take the periodicity into account.

It is also very easy to eliminate the periodicity. You only need to put the initial structure in the middle of the unit cell, that is, add (0.5,0.5,0.5) to your original atomic fractional coordinates. At this time, atoms will not cross the boundary, and the corresponding problem does not need to be considered.


Re: O2 Molecule Bond Length Result is Incorrect

Posted: Mon Nov 18, 2024 10:47 pm
by chulho_lee

To leszek_nowakowski and xin_zhao,

Thank you. After reading your explanation, I realized the importance of thinking differently under periodic boundary conditions.
As you suggested, I set the initial value to (0, 0, 0.1) instead of the origin, and I confirmed that the output appears near (0, 0, 0.15).
Looking back, it seems like a simple issue, but I was so worried that I even doubted if I had installed VASP correctly.

Thank you both for your guidance.