Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature DFTB+ #511

Merged
merged 15 commits into from
Aug 5, 2023
Merged

new feature DFTB+ #511

merged 15 commits into from
Aug 5, 2023

Conversation

ruio248
Copy link
Contributor

@ruio248 ruio248 commented Jul 26, 2023

No description provided.

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.17% 🎉

Comparison is base (47619b7) 82.77% compared to head (ff06388) 82.95%.
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #511      +/-   ##
==========================================
+ Coverage   82.77%   82.95%   +0.17%     
==========================================
  Files          71       73       +2     
  Lines        6428     6493      +65     
==========================================
+ Hits         5321     5386      +65     
  Misses       1107     1107              
Files Changed Coverage Δ
dpdata/dftbplus/output.py 100.00% <100.00%> (ø)
dpdata/plugins/dftbplus.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@njzjz njzjz changed the base branch from master to devel July 26, 2023 18:18
@njzjz njzjz linked an issue Jul 26, 2023 that may be closed by this pull request
energy = float(s[2])

symbols = np.array(symbols)
forces = -np.array(forces)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that DFTB+ outputs forces instead of gradients, so forces should not multiply by -1.

(need check)

import numpy as np


def read_dftb_plus(fn: str) -> Tuple[str, np.ndarray, float, np.ndarray]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DFTB+ has input and output files separately, so I suggest not merging them into one file. Instead, pass a directory or two file arguments.

Copy link
Contributor

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide doc for this format.

@ruio248 ruio248 closed this Jul 28, 2023
@njzjz njzjz reopened this Jul 28, 2023
@njzjz njzjz marked this pull request as draft July 28, 2023 19:54
@ruio248 ruio248 marked this pull request as ready for review July 31, 2023 02:43
Comment on lines 1 to 8
Geometry = GenFormat {
4 C
N H
1 1 1.014150 0.112320 0.047370
2 2 3.909390 0.037985 -0.101159
3 2 0.702550 -0.851820 -0.060860
4 2 0.702550 0.603740 -0.789160
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From dftb+ documentation

The second line contains the chemical symbols of the elements present separated by one or more spaces. The following n lines contain a list of the atoms. The first number is the atom number in the structure (this is currently ignored by the program). The second number is the chemical type from the list of symbols on line 2. Then follow the coordinates. For S and C format, these are x, y, z in Å, but for F they are fractions of the three lattice vectors.

So the unit is Angstrom

@ruio248
Copy link
Contributor Author

ruio248 commented Jul 31, 2023

Please provide doc for this format.
The doc is provided in dpdata/plugins/dftbplus.py

@njzjz njzjz requested a review from wanghan-iapcm July 31, 2023 18:32
Copy link
Contributor

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update dftb+ format to readme:

dpdata/README.md

Lines 54 to 89 in 85a3b5e

| Software| format | multi frames | labeled | class | format key |
| ------- | :--- | :---: | :---: | :--- | :--- |
| vasp | poscar | False | False | System | 'vasp/poscar' |
| vasp | outcar | True | True | LabeledSystem | 'vasp/outcar' |
| vasp | xml | True | True | LabeledSystem | 'vasp/xml' |
| lammps | lmp | False | False | System | 'lammps/lmp' |
| lammps | dump | True | False | System | 'lammps/dump' |
| deepmd | raw | True | False | System | 'deepmd/raw' |
| deepmd | npy | True | False | System | 'deepmd/npy' |
| deepmd | raw | True | True | LabeledSystem | 'deepmd/raw' |
| deepmd | npy | True | True | LabeledSystem | 'deepmd/npy' |
| deepmd | npy | True | True | MultiSystems | 'deepmd/npy/mixed' |
| deepmd | npy | True | False | MultiSystems | 'deepmd/npy/mixed' |
| gaussian| log | False | True | LabeledSystem | 'gaussian/log'|
| gaussian| log | True | True | LabeledSystem | 'gaussian/md' |
| siesta | output | False | True | LabeledSystem | 'siesta/output'|
| siesta | aimd_output | True | True | LabeledSystem | 'siesta/aimd_output' |
| cp2k | output | False | True | LabeledSystem | 'cp2k/output' |
| cp2k | aimd_output | True | True | LabeledSystem | 'cp2k/aimd_output' |
| QE | log | False | True | LabeledSystem | 'qe/pw/scf' |
| QE | log | True | False | System | 'qe/cp/traj' |
| QE | log | True | True | LabeledSystem | 'qe/cp/traj' |
| Fhi-aims| output | True | True | LabeledSystem | 'fhi_aims/md' |
| Fhi-aims| output | False | True | LabeledSystem | 'fhi_aims/scf' |
|quip/gap|xyz|True|True|MultiSystems|'quip/gap/xyz'|
| PWmat | atom.config | False | False | System | 'pwmat/atom.config' |
| PWmat | movement | True | True | LabeledSystem | 'pwmat/movement' |
| PWmat | OUT.MLMD | True | True | LabeledSystem | 'pwmat/out.mlmd' |
| Amber | multi | True | True | LabeledSystem | 'amber/md' |
| Amber/sqm | sqm.out | False | False | System | 'sqm/out' |
| Gromacs | gro | True | False | System | 'gromacs/gro' |
| ABACUS | STRU | False | False | System | 'abacus/stru' |
| ABACUS | STRU | False | True | LabeledSystem | 'abacus/scf' |
| ABACUS | cif | True | True | LabeledSystem | 'abacus/md' |
| ABACUS | STRU | True | True | LabeledSystem | 'abacus/relax' |
| ase | structure | True | True | MultiSystems | 'ase/structure' |

@wanghan-iapcm wanghan-iapcm merged commit 452a0e5 into deepmodeling:devel Aug 5, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dpdata with DFTB+
3 participants