OrderN / CONQUEST-release

Full public release of large scale and linear scaling DFT code CONQUEST
http://www.order-n.org/
MIT License
94 stars 24 forks source link

Add extended XYZ file output for static run and structural optimization #305

Closed JianboLin closed 2 months ago

JianboLin commented 3 months ago

We have an option for output of extended-xyz file in run types of MD simulation. But when we would like to check, save, or even visualize the atomic forces of specific geometry or during the structural optimization, add the same option in run types of static and structural optimization, would be convenient.

I plan to do this with following workflow:

  1. Add to and check in run types of static and structural optimization(cg_run, lbfgs, and sqnm),
  2. Add to and check in run types of structural optimization with cell optimization.
JianboLin commented 3 months ago

I have checked this branch with static, cg, lbfgs, sqnm and also with cell optimization. All of them can output extended xyz files with AtomMove.WriteExtXYZ T

The following shows a test with Si 8 atoms, cubic cell (shifted first atom in x axis) by static run: Coordination file(length unit: Bohr):

10.262912871373274 0.0000000000000 0.0000000000000
0.0000000000000 10.262912871373274 0.0000000000000
0.0000000000000 0.0000000000000 10.262912871373274
8
0.0500000000000 0.0000000000000 0.0000000000000 1 T T T
0.5000000000000 0.5000000000000 0.0000000000000 1 T T T
0.5000000000000 0.0000000000000 0.5000000000000 1 T T T
0.0000000000000 0.5000000000000 0.5000000000000 1 T T T
0.2500000000000 0.2500000000000 0.2500000000000 1 T T T
0.7500000000000 0.7500000000000 0.2500000000000 1 T T T
0.7500000000000 0.2500000000000 0.7500000000000 1 T T T
0.2500000000000 0.7500000000000 0.7500000000000 1 T T T

In Conquest_out, we have:

    force: Forces on atoms (Ha/a0)
    force:  Atom   X              Y              Z
    force:     1  -0.0915292599  -0.0000000000  -0.0000000000
    force:     2   0.0051225981  -0.0000000000  -0.0000000000
    force:     3   0.0051225981   0.0000000000  -0.0000000000
    force:     4  -0.0083033384  -0.0000000000   0.0000000000
    force:     5   0.0245641018   0.0235894111   0.0235894111
    force:     6   0.0201767060   0.0136070745  -0.0136070745
    force:     7   0.0201767060  -0.0136070745   0.0136070745
    force:     8   0.0245641018  -0.0235894111  -0.0235894111

In trajectory.xyz (units: eV, Å), we get :

8
config_type=Si8_cubic_static_OptcellF Lattice="5.43089961     0.00000000     0.00000000     0.00000000     5.43089961     0.00000000     0.00000000     0.00000000     5.43089961" Properties=species:S:1:pos:R:3:forces:R:3 potential_energy=-850.85764121 pbc="T T T"
  Si      0.27154498      0.00000000      0.00000000     -4.70662374     -0.00000000     -0.00000000
  Si      2.71544980      2.71544980      0.00000000      0.26341458     -0.00000000     -0.00000000
  Si      2.71544980      0.00000000      2.71544980      0.26341458      0.00000000     -0.00000000
  Si      0.00000000      2.71544980      2.71544980     -0.42697483     -0.00000000      0.00000000
  Si      1.35772490      1.35772490      1.35772490      1.26313689      1.21301628      1.21301628
  Si      4.07317470      4.07317470      1.35772490      1.03752793      0.69970390     -0.69970390
  Si      4.07317470      1.35772490      4.07317470      1.03752793     -0.69970390      0.69970390
  Si      1.35772490      4.07317470      4.07317470      1.26313689     -1.21301628     -1.21301628

If check the fx of first atom:

BohrToAng = 0.52917721067 
HaToeV = 27.21138602
-0.0915292599 Ha/a0 = -4.706623741620257 (-4.70662374) eV/Å

Please check and comment on this branch.

davidbowler commented 3 months ago

Can you please open a pull request for this, @JianboLin ? It should merge into develop. That way we can compare check and compare easily.

JianboLin commented 3 months ago

Thank you very much for your suggestion. @davidbowler I have open a pull request for this.

JianboLin commented 2 months ago

Have been merged in https://github.com/OrderN/CONQUEST-release/pull/318