Skip to content

Commit 08ea40c

Browse files
authored
Doc&Test: update the documentation about pseudopotential and orbitals (#5294)
* stash * complete * add unittest on to_qo_mpi * update the time of doc and capitalize espresso
1 parent 44076aa commit 08ea40c

File tree

6 files changed

+121
-26
lines changed

6 files changed

+121
-26
lines changed

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

source/module_io/test/to_qo_test.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ class toQOTest : public testing::Test
110110
protected:
111111
void SetUp() override
112112
{
113+
#ifdef __MPI
114+
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
115+
#endif
113116
}
114117

115118
void TearDown() override
116119
{
117120
}
118121
UnitCell ucell;
122+
int myrank = 0;
119123
};
120124

121125
TEST_F(toQOTest, Constructor)
@@ -1500,6 +1504,50 @@ TEST_F(toQOTest, CalculateHydrogenlike)
15001504
}
15011505
}
15021506

1507+
TEST_F(toQOTest, BcastStdvectorOfVector3Int)
1508+
{
1509+
#ifdef __MPI
1510+
std::vector<ModuleBase::Vector3<int>> vec;
1511+
if (this->myrank == 0)
1512+
{
1513+
vec.push_back(ModuleBase::Vector3<int>(1, 2, 3));
1514+
vec.push_back(ModuleBase::Vector3<int>(4, 5, 6));
1515+
vec.push_back(ModuleBase::Vector3<int>(7, 8, 9));
1516+
}
1517+
toQO::bcast_stdvector_ofvector3int(vec, myrank);
1518+
if (this->myrank != 0)
1519+
{
1520+
EXPECT_EQ(vec[0], ModuleBase::Vector3<int>(1, 2, 3));
1521+
EXPECT_EQ(vec[1], ModuleBase::Vector3<int>(4, 5, 6));
1522+
EXPECT_EQ(vec[2], ModuleBase::Vector3<int>(7, 8, 9));
1523+
}
1524+
#else
1525+
GTEST_SKIP();
1526+
#endif
1527+
}
1528+
1529+
TEST_F(toQOTest, BcastStdvectorOfVector3Double)
1530+
{
1531+
#ifdef __MPI
1532+
std::vector<ModuleBase::Vector3<double>> vec;
1533+
if (this->myrank == 0)
1534+
{
1535+
vec.push_back(ModuleBase::Vector3<double>(1.0, 2.0, 3.0));
1536+
vec.push_back(ModuleBase::Vector3<double>(4.0, 5.0, 6.0));
1537+
vec.push_back(ModuleBase::Vector3<double>(7.0, 8.0, 9.0));
1538+
}
1539+
toQO::bcast_stdvector_ofvector3double(vec, myrank);
1540+
if (this->myrank != 0)
1541+
{
1542+
EXPECT_EQ(vec[0], ModuleBase::Vector3<double>(1.0, 2.0, 3.0));
1543+
EXPECT_EQ(vec[1], ModuleBase::Vector3<double>(4.0, 5.0, 6.0));
1544+
EXPECT_EQ(vec[2], ModuleBase::Vector3<double>(7.0, 8.0, 9.0));
1545+
}
1546+
#else
1547+
GTEST_SKIP();
1548+
#endif
1549+
}
1550+
15031551
/**/
15041552
int main(int argc, char** argv)
15051553
{

source/module_io/to_qo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ class toQO
145145
void append_ovlpR_eiRk(int ik, int iR); //< append S(R) to S(k), memory saving
146146

147147
// MPI related
148-
void bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& vec);
149-
void bcast_stdvector_ofvector3double(std::vector<ModuleBase::Vector3<double>>& vec);
148+
static void bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& vec,
149+
const int rank);
150+
static void bcast_stdvector_ofvector3double(std::vector<ModuleBase::Vector3<double>>& vec,
151+
const int rank);
150152

151153
// Neighboring list
152154
/// @brief get all possible (n1n2n3) defining supercell and scatter if MPI enabled

source/module_io/to_qo_mpi.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
#include "../module_base/parallel_common.h"
44
#endif
55

6-
void toQO::bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& vec)
6+
void toQO::bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& vec,
7+
const int rank)
78
{
89
#ifdef __MPI
910
int dim;
1011
std::vector<int> vec_1d;
11-
if(iproc_ == 0)
12+
if(rank == 0)
1213
{
1314
dim = vec.size();
1415
for(int i = 0; i < dim; i++)
@@ -19,9 +20,9 @@ void toQO::bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& v
1920
}
2021
}
2122
Parallel_Common::bcast_int(dim);
22-
if(iproc_ != 0) vec_1d.resize(dim * 3);
23+
if(rank != 0) { vec_1d.resize(dim * 3); }
2324
Parallel_Common::bcast_int(vec_1d.data(), dim * 3);
24-
if(iproc_ != 0)
25+
if(rank != 0)
2526
{
2627
vec.clear(); vec.resize(dim);
2728
for(int i = 0; i < dim; i++)
@@ -32,12 +33,13 @@ void toQO::bcast_stdvector_ofvector3int(std::vector<ModuleBase::Vector3<int>>& v
3233
#endif
3334
}
3435

35-
void toQO::bcast_stdvector_ofvector3double(std::vector<ModuleBase::Vector3<double>>& vec)
36+
void toQO::bcast_stdvector_ofvector3double(std::vector<ModuleBase::Vector3<double>>& vec,
37+
const int rank)
3638
{
3739
#ifdef __MPI
3840
int dim;
3941
std::vector<double> vec_1d;
40-
if(iproc_ == 0)
42+
if(rank == 0)
4143
{
4244
dim = vec.size();
4345
for(int i = 0; i < dim; i++)
@@ -48,9 +50,9 @@ void toQO::bcast_stdvector_ofvector3double(std::vector<ModuleBase::Vector3<doubl
4850
}
4951
}
5052
Parallel_Common::bcast_int(dim);
51-
if(iproc_ != 0) vec_1d.resize(dim * 3);
53+
if(rank != 0) { vec_1d.resize(dim * 3); }
5254
Parallel_Common::bcast_double(vec_1d.data(), dim * 3);
53-
if(iproc_ != 0)
55+
if(rank != 0)
5456
{
5557
vec.clear(); vec.resize(dim);
5658
for(int i = 0; i < dim; i++)

source/module_io/to_qo_structures.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void toQO::scan_supercell(const int& rank, const int& nranks)
219219
#ifdef __MPI // scatter supercells_ to all ranks
220220
Parallel_Common::bcast_int(nR_);
221221
Parallel_Common::bcast_int(nR_tot_);
222-
bcast_stdvector_ofvector3int(supercells_);
222+
bcast_stdvector_ofvector3int(supercells_, iproc_);
223223
// scatter
224224
std::vector<std::vector<int>> nR_divided(nranks); // indiced by iproc, then list of indices of supercells_
225225
if(rank == 0)

0 commit comments

Comments
 (0)