Skip to content

Commit 44ad0a3

Browse files
committed
Merge branch 'develop' of https://github.com/deepmodeling/abacus-develop into hotfix
2 parents c2032ce + 146a509 commit 44ad0a3

Some content is hidden

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

50 files changed

+895
-212
lines changed

docs/advanced/elec_properties/Berry_phase.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pseudo_dir ../../../tests/PP_ORB //the path to locate the pesudopotential
2323
orbital_dir ../../../tests/PP_ORB //the path to locate the numerical orbital files
2424
ntype 3
2525
ecutwfc 50 // Ry
26-
symmetry 0 // turn off symmetry
26+
symmetry -1 // turn off symmetry
2727
calculation nscf // non-self-consistent calculation
2828
basis_type lcao // atomic basis
2929
init_chg file // read charge from files
@@ -70,4 +70,6 @@ The results are shown as follows:
7070
P = 0.8906925 (mod 2.1748536) ( 0.0000000, 0.0000000, 0.8906925) C/m^2
7171
```
7272

73-
The electric polarization **P** is multivalued, which modulo a quantum e**R**/V~cell~. Note: the values in parentheses are the components of the **P** along the c axis in the x, y, z Cartesian coordinates when set gdir = 3 in INPUT file.
73+
The electric polarization **P** is multivalued, which modulo a quantum e**R**/V~cell~.
74+
75+
Note: The vectors R1, R2, and R3 refer to the three lattice vectors of the unit cell. When gdir=3, the calculated polarization is along the R3 direction. The three values in parentheses represent the re-projection of the polarization along the R3 direction onto the Cartesian coordinate system (i.e., the xyz coordinate system). To obtain the full polarization components in the Cartesian system, you need to calculate the polarization for R1, R2, and R3 separately, and then sum their respective x, y, and z components.

docs/advanced/pp_orb.md

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ Inside ABACUS, orbitals in LCAO basis are arranged lexicographically by species-
1919

2020
## Generating atomic orbital bases
2121

22-
Users may also choose to generate their own atomic obitals. In ABACUS, the atomic orbital bases are generated using a scheme developed in the [paper](https://iopscience.iop.org/article/10.1088/0953-8984/22/44/445501). A detailed description of the procedure for generating orbitals will be provided later.
22+
Users may also generate ABACUS numerical atomic obitals based on their own flavor. The theoretical background of orbital generation can be found in following works:
23+
24+
- Spillage: [Chen M, Guo G C, He L. Systematically improvable optimized atomic basis sets for ab initio calculations[J]. Journal of Physics: Condensed Matter, 2010, 22(44): 445501.](https://iopscience.iop.org/article/10.1088/0953-8984/22/44/445501)
25+
- PTG DPSI: [Lin P, Ren X, He L. Strategy for constructing compact numerical atomic orbital basis sets by incorporating the gradients of reference wavefunctions[J]. Physical Review B, 2021, 103(23): 235131.](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.103.235131)
26+
27+
Guidelines for generating atomic orbital bases are as follows:
28+
29+
- [Numerical Atomic Orbitals 1: the nomenclature and usage of numerical atomic orbitals in ABACUS](https://mcresearch.github.io/abacus-user-guide/abacus-nac1.html) (Chinese)
30+
- [Numerical Atomic Orbitals 2: generate numerical atomic orbitals based on given norm-conserving pseudopotential](https://mcresearch.github.io/abacus-user-guide/abacus-nac1.html) (Chinese)
31+
- [Numerical Atomic Orbitals 3: generate high-precision numerical atomic orbitals](https://mcresearch.github.io/abacus-user-guide/abacus-nac1.html) (Chinese)
32+
33+
Stable orbital generation programs can be found in guidelines above, there is also another developing version of orbital generation program, in which algorithms are consecutively improved: [Github repository of ABACUS ORBGEN project](https://github.com/kirk0830/ABACUS-ORBGEN), the usage of which can be found in README (in English) file.
34+
35+
*NOTE*: users are encouraged to cite the above works when numerical atomic orbitals and its generation codes are used in their research.
2336

2437
## BSSE Correction
2538

@@ -51,16 +64,46 @@ $$
5164
$$
5265

5366
## Pseudopotentials
54-
55-
In ABACUS, we support norm-conserving and ultrasoft pseudopotentials.
56-
For norm-conserving pseudopotentials, we support four different formats of the pseudopotential files: UPF, UPF2, VWR, and BLPS.
57-
For ultrasoft pseudopotentials, currently we support only one format of the pseudopotential files: UPF2.
58-
59-
For more information, check the `ATOMIC_SPECIES` section in the specification of the [STRU file](./input_files/stru.md).
60-
61-
Here we list some common sources of the pseudopotential files:
62-
63-
1. [Quantum ESPRESSO](http://www.quantum-espresso.org/pseudopotentials/).
64-
2. [SG15-ONCV](http://quantum-simulation.org/potentials/sg15_oncv/upf/).
65-
3. [DOJO](http://www.pseudo-dojo.org/).
66-
4. [BLPS](https://github.com/PrincetonUniversity/BLPSLibrary).
67+
### Supported formats
68+
ABACUS supports both norm-conserving and ultrasoft pseudopotentials. For norm-conserving pseudopotentials, UPF, UPF2, VWR, and BLPS formats are supported. For ultrasoft pseudopotentials, UPF and UPF2 formats are supported.
69+
70+
### Usage
71+
For more information about pseudopotential usage, check the `ATOMIC_SPECIES` section in the specification of the [STRU file](./input_files/stru.md).
72+
73+
### Download
74+
Users can find pseudopotentials in the following links:
75+
76+
**Website**
77+
- [Quantum ESPRESSO](https://www.quantum-espresso.org/pseudopotentials): the official website of Quantum ESPRESSO, where you can find a large number of pseudopotential files.
78+
- [Stantard Solid State Pseudopotential library](https://www.materialscloud.org/sssp): a library of **high-quality** pseudopotentials for solid-state calculations, with **a large number of tests on efficiency and precison**.
79+
- [PWmat](http://www.pwmat.com/potential-download): a website that provides a large number of pseudopotential files, various kinds of semi-core constructed pseudopotentials are included. **Several sets (with or without f-electrons/noncolinear core correction) of Lanthanide pseudopotentials are also available**.
80+
- [THEOS](http://theossrv1.epfl.ch/Main/Pseudopotentials): PSlibrary 0.3.1, a library of pseudopotentials for DFT calculations, including ultrasoft, paw, norm-conserving both full-relativistic and scalar-relativistic pseudopotentials.
81+
- [ABACUS@USTC](https://abacus.ustc.edu.cn/pseudo/list.htm): **ABACUS official website** where you can find a large number of pseudopotential files and numerical atomic orbital files.
82+
- [BLPS](https://github.com/PrincetonUniversity/BLPSLibrary): BLPS format pseudopotential library
83+
84+
**Norm-conserving pseudopotentials**
85+
- [SG15](http://www.quantum-simulation.org/potentials/sg15_oncv/): **vastly used in ABACUS** DFT calculation and numerical atomic orbital generation.
86+
- [PseudoDOJO](http://www.pseudo-dojo.org/): another widely used pseudopotential database, developed by Abinit group, **including Lanthanide pseudopotentials (f-electrons frozen)**.
87+
- [The Rappe group](https://www.sas.upenn.edu/rappegroup/research/pseudo-potential-gga.html): a collection of GGA pseudopotentials which are generated with Opium code, several tests proves that are out-performing in alloy systems.
88+
- [Matteo Giantomassi's Github repo](https://github.com/gmatteo/pseudos_ac_she): a Github repository that contains norm-conserving pseudopotentials for **Actinides and superheavy elements to 120-th element**.
89+
90+
**Ultrasoft pseudopotentials**
91+
- [Vanderbilt](http://www.physics.rutgers.edu/~dhv/uspp/): a collection of ultrasoft pseudopotentials generated by Vanderbilt group.
92+
- [GBRV](https://www.physics.rutgers.edu/gbrv/) by Kevin F. Garrity, Joseph W. Bennett, Karin M. Rabe, and David Vanderbilt: presently the most popular ultrasoft pseudpotentials in Quantum ESPRESSO user community.
93+
94+
### Pseudopotential Generation
95+
For pseudopotential generation, please refer to the following links for more information:
96+
- [Quantum ESPRESSO](http://www.quantum-espresso.org/pseudopotentials/)
97+
- [ONCVPSP](http://www.mat-simresearch.com/)
98+
- [Opium](https://opium.sourceforge.net/)
99+
100+
A Chinese guideline is also available here: [A brief introduction of norm-conserving pseudopotential generation](https://mcresearch.github.io/abacus-user-guide/abacus-upf.html)
101+
102+
# ABACUS Pseudopotential-Numerical atomic orbital Square (APNS) project
103+
For the purpose of providing high-quality pseudopotentials and numerical atomic orbitals, we have initiated the APNS project. The project is aimed at providing a large number of high-quality pseudopotentials and numerical atomic orbitals, along with diverse test data for the ABACUS user community, reduce the cost of generating and testing pseudopotentials and numerical atomic orbitals by users, and promote the development of ABACUS software. The project is currently in the development stage, and we welcome contributions from the community. For more information, please refer to the following links:
104+
- [APNS website: test data and results](https://kirk0830.github.io/ABACUS-Pseudopot-Nao-Square/)
105+
- [APNS workflow (Github repository): high-throughput test of pseudopotentials and numerical atomic orbitals](https://github.com/kirk0830/ABACUS-Pseudopot-Nao-Square)
106+
107+
There are also other excellent projects that provide high-quality pseudopotentials along with test data:
108+
- [Solid State Pseudopotential library](https://www.materialscloud.org/sssp)
109+
- [Verification of the precision of DFT implementation via AiiDA common workflows](https://acwf-verification.materialscloud.org/)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = 'ABACUS'
21-
copyright = '2022, ABACUS'
21+
copyright = '2024, ABACUS'
2222
author = 'ABACUS'
2323

2424
# The full version, including alpha/beta/rc tags

examples/berryphase/lcao_PbTiO3/INPUT-nscf-a

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pseudo_dir ../../../tests/PP_ORB
33
orbital_dir ../../../tests/PP_ORB
44
ntype 3
55
ecutwfc 50
6-
symmetry 0
6+
symmetry -1
77
calculation nscf
88
basis_type lcao
99
init_chg file

examples/berryphase/lcao_PbTiO3/INPUT-nscf-b

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pseudo_dir ../../../tests/PP_ORB
33
orbital_dir ../../../tests/PP_ORB
44
ntype 3
55
ecutwfc 50
6-
symmetry 0
6+
symmetry -1
77
calculation nscf
88
basis_type lcao
99
init_chg file

examples/berryphase/lcao_PbTiO3/INPUT-nscf-c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pseudo_dir ../../../tests/PP_ORB
33
orbital_dir ../../../tests/PP_ORB
44
ntype 3
55
ecutwfc 50
6-
symmetry 0
6+
symmetry -1
77
calculation nscf
88
basis_type lcao
99
init_chg file

examples/berryphase/pw_PbTiO3/INPUT-nscf-a

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ INPUT_PARAMETERS
22
pseudo_dir ../../../tests/PP_ORB
33
ntype 3
44
ecutwfc 50
5-
symmetry 0
5+
symmetry -1
66
pw_diag_thr 1e-10
77
calculation nscf
88
basis_type pw

examples/berryphase/pw_PbTiO3/INPUT-nscf-b

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ INPUT_PARAMETERS
22
pseudo_dir ../../../tests/PP_ORB
33
ntype 3
44
ecutwfc 50
5-
symmetry 0
5+
symmetry -1
66
pw_diag_thr 1e-10
77
calculation nscf
88
basis_type pw

examples/berryphase/pw_PbTiO3/INPUT-nscf-c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ INPUT_PARAMETERS
22
pseudo_dir ../../../tests/PP_ORB
33
ntype 3
44
ecutwfc 50
5-
symmetry 0
5+
symmetry -1
66
pw_diag_thr 1e-10
77
calculation nscf
88
basis_type pw
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#include "module_base/grid/partition.h"
2+
#include "module_base/constants.h"
3+
4+
#include <cmath>
5+
#include <functional>
6+
#include <numeric>
7+
#include <algorithm>
8+
#include <vector>
9+
#include <cassert>
10+
11+
namespace Grid {
12+
namespace Partition {
13+
14+
const double stratmann_a = 0.64;
15+
16+
double w_becke(
17+
int nR0,
18+
const double* drR,
19+
const double* dRR,
20+
int nR,
21+
const int* iR,
22+
int c
23+
) {
24+
assert(nR > 0 && nR0 >= nR);
25+
std::vector<double> P(nR, 1.0);
26+
for (int i = 0; i < nR; ++i) {
27+
int I = iR[i];
28+
for (int j = i + 1; j < nR; ++j) {
29+
int J = iR[j];
30+
double mu = (drR[I] - drR[J]) / dRR[I*nR0 + J];
31+
double s = s_becke(mu);
32+
P[I] *= s;
33+
P[J] *= (1.0 - s); // s(-mu) = 1 - s(mu)
34+
}
35+
}
36+
return P[c] / std::accumulate(P.begin(), P.end(), 0.0);
37+
}
38+
39+
40+
double s_becke(double mu) {
41+
/*
42+
* Becke's iterated polynomials (3rd order)
43+
*
44+
* s(mu) = 0.5 * (1 - p(p(p(mu))))
45+
*
46+
* p(x) = 0.5 * x * (3 - x^2)
47+
*
48+
*/
49+
double p = 0.5 * mu * (3.0 - mu*mu);
50+
p = 0.5 * p * (3.0 - p*p);
51+
p = 0.5 * p * (3.0 - p*p);
52+
return 0.5 * (1.0 - p);
53+
}
54+
55+
56+
double w_stratmann(
57+
int nR0,
58+
const double* drR,
59+
const double* dRR,
60+
const double* drR_thr,
61+
int nR,
62+
int* iR,
63+
int c
64+
) {
65+
assert(nR > 0 && nR0 >= nR);
66+
int I = iR[c], J = 0;
67+
68+
// If r falls within the exclusive zone of a center, return immediately.
69+
for (int j = 0; j < nR; ++j) {
70+
J = iR[j];
71+
if (drR[J] <= drR_thr[J]) {
72+
return static_cast<double>(I == J);
73+
}
74+
}
75+
76+
// Even if the grid point does not fall within the exclusive zone of any
77+
// center, the normalized weight could still be 0 or 1, and this can be
78+
// figured out by examining the unnormalized weight alone.
79+
80+
// Swap the grid center to the first position in iteration for convenience.
81+
// Restore the original order before return.
82+
std::swap(iR[0], iR[c]);
83+
84+
std::vector<double> P(nR);
85+
for (int j = 1; j < nR; ++j) {
86+
J = iR[j];
87+
double mu = (drR[I] - drR[J]) / dRR[I*nR0 + J];
88+
P[j] = s_stratmann(mu);
89+
}
90+
P[0] = std::accumulate(P.begin() + 1, P.end(), 1.0,
91+
std::multiplies<double>());
92+
93+
if (P[0] == 0.0 || P[0] == 1.0) {
94+
std::swap(iR[0], iR[c]); // restore the original order
95+
return P[0];
96+
}
97+
98+
// If it passes all the screening above, all unnormalized weights
99+
// have to be calculated in order to get the normalized weight.
100+
101+
std::for_each(P.begin() + 1, P.end(), [](double& s) { s = 1.0 - s; });
102+
for (int i = 1; i < nR; ++i) {
103+
I = iR[i];
104+
for (int j = i + 1; j < nR; ++j) {
105+
J = iR[j];
106+
double mu = (drR[I] - drR[J]) / dRR[I*nR0 + J];
107+
double s = s_stratmann(mu);
108+
P[i] *= s;
109+
P[j] *= (1.0 - s); // s(-mu) = 1 - s(mu)
110+
}
111+
}
112+
113+
std::swap(iR[0], iR[c]); // restore the original order
114+
return P[0] / std::accumulate(P.begin(), P.end(), 0.0);
115+
}
116+
117+
118+
double s_stratmann(double mu) {
119+
/*
120+
* Stratmann's piecewise cell function
121+
*
122+
* s(mu) = 0.5 * (1 - g(mu/a))
123+
*
124+
* / -1 x <= -1
125+
* |
126+
* g(x) = | (35x - 35x^3 + 21x^5 - 5x^7) / 16 |x| < 1
127+
* |
128+
* \ +1 x >= +1
129+
*
130+
*/
131+
double x = mu / stratmann_a;
132+
double x2 = x * x;
133+
double h = 0.0625 * x * (35 + x2 * (-35 + x2 * (21 - 5 * x2)));
134+
135+
bool mid = std::abs(x) < 1;
136+
double g = !mid * (1 - 2 * std::signbit(x)) + mid * h;
137+
return 0.5 * (1.0 - g);
138+
}
139+
140+
141+
} // end of namespace Partition
142+
} // end of namespace Grid

0 commit comments

Comments
 (0)