Skip to content

Commit 82991ca

Browse files
authored
Merge branch 'develop' into mtblas_memory
2 parents d159974 + e27ac49 commit 82991ca

File tree

38 files changed

+1023
-241
lines changed

38 files changed

+1023
-241
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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/).

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ These variables are used to control the plane wave related parameters.
728728

729729
- **Type**: Real
730730
- **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.
731-
- **Default**: 50
731+
- **Default**: 50 Ry (PW basis), 100 Ry (LCAO basis)
732732

733733
### ecutrho
734734

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

source/module_hamilt_general/module_xc/xc_functional_gradcorr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void XC_Functional::gradcorr(double &etxc, double &vtxc, ModuleBase::matrix &v,
184184
}
185185

186186
gdr2 = new ModuleBase::Vector3<double>[rhopw->nrxx];
187-
h2 = new ModuleBase::Vector3<double>[rhopw->nrxx];
187+
if(!is_stress) h2 = new ModuleBase::Vector3<double>[rhopw->nrxx];
188188

189189
XC_Functional::grad_rho( rhogsum1 , gdr1, rhopw, ucell->tpiba);
190190
XC_Functional::grad_rho( rhogsum2 , gdr2, rhopw, ucell->tpiba);

source/module_hamilt_general/module_xc/xc_functional_libxc.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,30 @@
1111
#include <xc.h>
1212

1313
#include <vector>
14+
bool xc_with_laplacian(const std::string& xc_func_in)
15+
{
16+
// see Pyscf: https://github.com/pyscf/pyscf/blob/master/pyscf/dft/libxc.py#L1062
17+
// ABACUS issue: https://github.com/deepmodeling/abacus-develop/issues/5372
18+
const std::vector<std::string> not_supported = {
19+
"MGGA_XC_CC06", "MGGA_C_CS", "MGGA_X_BR89", "MGGA_X_MK00"};
20+
for (const std::string& s : not_supported)
21+
{
22+
if (xc_func_in.find(s) != std::string::npos)
23+
{
24+
return true;
25+
}
26+
}
27+
return false;
28+
}
1429

1530
std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::string xc_func_in)
1631
{
1732
// determine the type (lda/gga/mgga)
33+
if (xc_with_laplacian(xc_func_in))
34+
{
35+
ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc",
36+
"XC Functional involving Laplacian of rho is not implemented.");
37+
}
1838
int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga
1939
func_type = 1;
2040
if(xc_func_in.find("GGA") != std::string::npos) { func_type = 2; }

source/module_hamilt_pw/hamilt_pwdft/forces_nl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void Forces<FPTYPE, Device>::cal_force_nl(ModuleBase::matrix& forcenl,
4545
break;
4646
}
4747
}
48-
const int npm = ucell_in.get_npol() * nbands_occ;
48+
const int npm = nbands_occ;
4949
// calculate becp = <psi|beta> for all beta functions
5050
nl_tools.cal_becp(ik, npm);
5151
for (int ipol = 0; ipol < 3; ipol++)

0 commit comments

Comments
 (0)