Skip to content

Commit 59371ce

Browse files
committed
prepare for PR
2 parents 69551e2 + 9db254c commit 59371ce

File tree

128 files changed

+3080
-2150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+3080
-2150
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
# About ABACUS
1414

15-
ABACUS (Atomic-orbital Based Ab-initio Computation at UStc) is an open-source package based on density functional theory (DFT). The package utilizes both plane wave and numerical atomic basis sets with the usage of norm-conserving pseudopotentials to describe the interactions between nuclear ions and valence electrons. ABACUS supports LDA, GGA, meta-GGA, and hybrid functionals. Apart from single-point calculations, the package allows geometry optimizations and ab-initio molecular dynamics with various ensembles. The package also provides a variety of advanced functionalities for simulating materials, including the DFT+U, VdW corrections, and implicit solvation model, etc. In addition, ABACUS strives to provide a general infrastructure to facilitate the developments and applications of novel machine-learning-assisted DFT methods (DeePKS, DP-GEN, DeepH, etc.) in molecular and material simulations.
15+
ABACUS (Atomic-orbital Based Ab-initio Computation at UStc) is an open-source package based on density functional theory (DFT). The package utilizes both plane wave and numerical atomic basis sets with the usage of norm-conserving pseudopotentials to describe the interactions between nuclear ions and valence electrons. ABACUS supports LDA, GGA, meta-GGA, and hybrid functionals. Apart from single-point calculations, the package allows geometry optimizations and ab-initio molecular dynamics with various ensembles. The package also provides a variety of advanced functionalities for simulating materials, including the DFT+U, VdW corrections, and implicit solvation model, etc. In addition, ABACUS strives to provide a general infrastructure to facilitate the developments and applications of novel machine-learning-assisted DFT methods (DeePKS, DP-GEN, DeepH, DeePTB etc.) in molecular and material simulations.
1616

1717
# Online Documentation
1818
For detailed documentation, please refer to [our documentation website](https://abacus.deepmodeling.com/).
19+
20+
See our [Github Pages](https://mcresearch.github.io/abacus-user-guide/) for more tutorials and developer guides.

docs/CITATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following references are required to be cited when using ABACUS. Specificall
2626

2727
- **If DeePKS is used:**
2828

29-
Wenfei Li, Qi Ou, et al. "DeePKS+ABACUS as a Bridge between Expensive Quantum Mechanical Models and Machine Learning Potentials." <https://arxiv.org/abs/2206.10093>.
29+
Wenfei Li, Qi Ou, et al. "DeePKS+ABACUS as a Bridge between Expensive Quantum Mechanical Models and Machine Learning Potentials." J. Phys. Chem. A 126.49 (2022): 9154-9164.
3030

3131
- **If hybrid functional is used:**
3232

docs/advanced/input_files/input-main.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@
428428
- [ri\_hartree\_benchmark](#ri_hartree_benchmark)
429429
- [aims_nbasis](#aims_nbasis)
430430
- [Reduced Density Matrix Functional Theory](#Reduced-Density-Matrix-Functional-Theory)
431-
- [ab\_initio\_type](#ab_initio_type)
431+
- [rdmft](#rdmft)
432432
- [rdmft\_power\_alpha](#rdmft_power_alpha)
433433

434434
[back to top](#full-list-of-input-keywords)
@@ -731,7 +731,7 @@ These variables are used to control the plane wave related parameters.
731731

732732
- **Type**: Real
733733
- **Description**: Energy cutoff for plane wave functions, the unit is **Rydberg**. Note that even for localized orbitals basis, you still need to setup an energy cutoff for this system. Because our local pseudopotential parts and the related force are calculated from plane wave basis set, etc. Also, because our orbitals are generated by matching localized orbitals to a chosen set of wave functions from a certain energy cutoff, this set of localize orbitals is most accurate under this same plane wave energy cutoff.
734-
- **Default**: 50
734+
- **Default**: 50 Ry (PW basis), 100 Ry (LCAO basis)
735735

736736
### ecutrho
737737

@@ -3928,7 +3928,7 @@ Currently supported: `RPA`, `LDA`, `PBE`, `HSE`, `HF`.
39283928

39293929
- **Type**: String
39303930
- **Description**: The method to solve the Casida equation $AX=\Omega X$ in LR-TDDFT under Tamm-Dancoff approximation (TDA), where $A_{ai,bj}=(\epsilon_a-\epsilon_i)\delta_{ij}\delta_{ab}+(ai|f_{Hxc}|bj)+\alpha_{EX}(ab|ij)$ is the particle-hole excitation matrix and $X$ is the transition amplitude.
3931-
- `dav`: Construct $AX$ and diagonalize the Hamiltonian matrix iteratively with Davidson algorithm.
3931+
- `dav`/`dav_subspace`/ `cg`: Construct $AX$ and diagonalize the Hamiltonian matrix iteratively with Davidson/Non-ortho-Davidson/CG algorithm.
39323932
- `lapack`: Construct the full $A$ matrix and directly diagonalize with LAPACK.
39333933
- `spectrum`: Calculate absorption spectrum only without solving Casida equation. The `OUT.${suffix}/` directory should contain the
39343934
files for LR-TDDFT eigenstates and eigenvalues, i.e. `Excitation_Energy.dat` and `Excitation_Amplitude_${processor_rank}.dat`
@@ -4007,11 +4007,11 @@ The output files are `OUT.${suffix}/Excitation_Energy.dat` and `OUT.${suffix}/Ex
40074007
ab-initio methods and the xc-functional parameters used in RDMFT.
40084008
The physical quantities that RDMFT temporarily expects to output are the kinetic energy, total energy, and 1-RDM of the system in the ground state, etc.
40094009

4010-
### ab_initio_type
4010+
### rdmft
40114011

4012-
- **Type**: String
4013-
- **Description**: Determine the ab-initio method, ksdft or rdmft (reduced density matrix funcional theory)
4014-
- **Default**: ksdft
4012+
- **Type**: Boolean
4013+
- **Description**: Whether to perform rdmft calculation (reduced density matrix funcional theory)
4014+
- **Default**: false
40154015

40164016
### rdmft_power_alpha
40174017

docs/advanced/interface/deepks.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# DeePKS
22

3-
[DeePKS](https://pubs.acs.org/doi/10.1021/acs.jctc.0c00872) is a machine-learning aided density funcitonal model that fits the energy difference between highly accurate but computationally demanding method and effcient but less accurate method via neural-network. As such, the trained DeePKS model can provide highly accurate energetics (and forces) with relatively low computational cost, and can therefore act as a bridge to connect expensive quantum mechanic data and machine-learning-based potentials. While the original framework of DeePKS is for molecular systems, please refer to this [reference](https://arxiv.org/abs/2206.10093) for the application of DeePKS in periodic systems.
3+
[DeePKS](https://pubs.acs.org/doi/10.1021/acs.jctc.0c00872) is a machine-learning (ML) aided density funcitonal model that fits the energy difference between highly accurate but computationally demanding method and effcient but less accurate method via neural-network. Common high-precision methods include hybrid functionals or CCSD-T, while common low-precision methods are LDA/GGA.
44

5-
Detailed instructions on installing and running DeePKS can be found on this [website](https://deepks-kit.readthedocs.io/en/latest/index.html). An [example](https://github.com/deepmodeling/deepks-kit/tree/abacus/examples/water_single_lda2pbe_abacus) for training DeePKS model with ABACUS is also provided. The DeePKS-related keywords in `INPUT` file can be found [here](http://abacus.deepmodeling.com/en/latest/advanced/input_files/input-main.html#deepks).
5+
As such, the trained DeePKS model can provide highly accurate energetics (and forces/band gap/density) with relatively low computational cost, and can therefore act as a bridge to connect expensive quantum mechanic data and machine-learning-based potentials.
6+
While the original framework of DeePKS is for molecular systems, please refer to this [J. Phys. Chem. A 126.49 (2022): 9154-9164](https://pubs.acs.org/doi/abs/10.1021/acs.jpca.2c05000) for the application of DeePKS in periodic systems.
67

7-
> Note: Use the LCAO basis for DeePKS-related calculations
8+
Detailed instructions on installing and running DeePKS can be found on this [website](https://deepks-kit.readthedocs.io/en/latest/index.html). The DeePKS-related keywords in `INPUT` file can be found [here](http://abacus.deepmodeling.com/en/latest/advanced/input_files/input-main.html#deepks). An [example](https://github.com/deepmodeling/deepks-kit/tree/abacus/examples/water_single_lda2pbe_abacus) for training DeePKS model with ABACUS is also provided. For practical applications, users can refer to a series of [Notebooks](https://bohrium.dp.tech/collections/1921409690). These Notebooks provide detailed instructions on how to train and use the DeePKS model using perovskite as an example. Currently, these tutorials are available in Chinese, but we plan to release corresponding English versions in the near future.
9+
10+
11+
12+
> Note: DeePKS calculations can only be performed by the LCAO basis.
813
914

docs/advanced/interface/deeptb.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DeePTB
2+
3+
[DeePTB](https://github.com/deepmodeling/DeePTB) is an innovative Python package that uses deep learning to accelerate ab initio electronic structure simulations. It offers versatile, accurate, and efficient simulations for a wide range of materials and phenomena. Trained on small systems, DeePTB can predict electronic structures of large systems, handle structural perturbations, and integrate with molecular dynamics for finite temperature simulations, providing comprehensive insights into atomic and electronic behavior. See more details in [DeePTB-SK: Nat Commun 15, 6772 (2024)](https://www.nature.com/articles/s41467-024-51006-4) and [DeePTB-E3: arXiv:2407.06053](https://arxiv.org/pdf/2407.06053).
4+
5+
DeePTB trains the model based on the Structure, Eigenvalues, Hamiltonian, Density matrix, and Overlap matrix from first-principles calcualtions. DeePTB team provides the interfaces [dftio](https://github.com/deepmodeling/dftio) with other first-principles softwares. [dftio](https://github.com/deepmodeling/dftio) fully supports the interfaces with ABACUS, and can transfer the Structure, Eigenvalues, Hamiltonian, Density matrix, and Overlap matrix from ABACUS into the format used in [DeePTB](https://github.com/deepmodeling/DeePTB).

docs/advanced/interface/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Interfaces to Other Softwares
99
deepks
1010
dpgen
1111
deeph
12+
deeptb
1213
Hefei-NAMD
1314
phonopy
1415
Wannier90

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
extensions = [
3434
'myst_parser',
3535
'deepmodeling_sphinx',
36-
'sphinxcontrib.jquery',
3736
]
3837
myst_enable_extensions = [
3938
"amsmath",
@@ -66,7 +65,7 @@
6665
# The theme to use for HTML and HTML Help pages. See the documentation for
6766
# a list of builtin themes.
6867
#
69-
html_theme = 'sphinx_rtd_theme'
68+
html_theme = 'sphinx_book_theme'
7069
html_logo = 'abacus-logo.svg'
7170

7271

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
urllib3
22
myst_parser[linkify]
3-
sphinx_rtd_theme
4-
deepmodeling_sphinx
3+
sphinx-book-theme
4+
deepmodeling-sphinx>=0.3.0

python/pyabacus/examples/diago_matrix.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ def load_mat(mat_file):
1010
return h_mat, nbasis, nband
1111

1212
def calc_eig_pyabacus(mat_file, method):
13-
algo = {
13+
dav = {
1414
'dav_subspace': hsolver.dav_subspace,
1515
'davidson': hsolver.davidson
1616
}
17+
cg = {
18+
'cg': hsolver.cg
19+
}
1720

1821
h_mat, nbasis, nband = load_mat(mat_file)
1922

@@ -22,25 +25,27 @@ def calc_eig_pyabacus(mat_file, method):
2225
diag_elem = np.where(np.abs(diag_elem) < 1e-8, 1e-8, diag_elem)
2326
precond = 1.0 / np.abs(diag_elem)
2427

25-
def mm_op(x):
28+
def mvv_op(x):
2629
return h_mat.dot(x)
2730

28-
e, _ = algo[method](
29-
mm_op,
30-
v0,
31-
nbasis,
32-
nband,
33-
precond,
34-
dav_ndim=8,
35-
tol=1e-8,
36-
max_iter=1000
37-
)
31+
if method in dav:
32+
algo = dav[method]
33+
# args: mvvop, init_v, dim, num_eigs, precondition, dav_ndim, tol, max_iter
34+
args = (mvv_op, v0, nbasis, nband, precond, 8, 1e-12, 5000)
35+
elif method in cg:
36+
algo = cg[method]
37+
# args: mvvop, init_v, dim, num_eigs, precondition, tol, max_iter
38+
args = (mvv_op, v0, nbasis, nband, precond, 1e-12, 5000)
39+
else:
40+
raise ValueError(f"Method {method} not available")
41+
42+
e, _ = algo(*args)
3843

3944
print(f'eigenvalues calculated by pyabacus-{method} is: \n', e)
4045

4146
return e
4247

43-
def calc_eig_scipy(mat_file):
48+
def calc_eigsh(mat_file):
4449
h_mat, _, nband = load_mat(mat_file)
4550
e, _ = scipy.sparse.linalg.eigsh(h_mat, k=nband, which='SA', maxiter=1000)
4651
e = np.sort(e)
@@ -50,13 +55,12 @@ def calc_eig_scipy(mat_file):
5055

5156
if __name__ == '__main__':
5257
mat_file = './Si2.mat'
53-
method = ['dav_subspace', 'davidson']
58+
method = ['dav_subspace', 'davidson', 'cg']
5459

5560
for m in method:
5661
print(f'\n====== Calculating eigenvalues using {m} method... ======')
5762
e_pyabacus = calc_eig_pyabacus(mat_file, m)
58-
e_scipy = calc_eig_scipy(mat_file)
63+
e_scipy = calc_eigsh(mat_file)
5964

6065
print('eigenvalues difference: \n', e_pyabacus - e_scipy)
61-
62-
66+

python/pyabacus/src/hsolver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
list(APPEND _diago
33
${HSOLVER_PATH}/diago_dav_subspace.cpp
44
${HSOLVER_PATH}/diago_david.cpp
5+
${HSOLVER_PATH}/diago_cg.cpp
56
${HSOLVER_PATH}/diag_const_nums.cpp
67
${HSOLVER_PATH}/diago_iter_assist.cpp
78

0 commit comments

Comments
 (0)