Skip to content

Commit e6245a6

Browse files
Update docs related to inputs, scf_thr and ase-abacus (#5922)
* update brief intro for INPUT * update bohr raduis in input.md * scf_thr recommendation * add dots * add suffix meaning * update ase.md * update description of scf_thr_type * update Unit in scf_thr * update suggestions * update "see documents for detail" * update input.md
1 parent 107024c commit e6245a6

File tree

3 files changed

+52
-28
lines changed

3 files changed

+52
-28
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
- [kspacing](#kspacing)
2121
- [min\_dist\_coef](#min_dist_coef)
2222
- [device](#device)
23-
- [nb2d](#nb2d)
2423
- [precision](#precision)
24+
- [nb2d](#nb2d)
2525
- [Variables related to input files](#variables-related-to-input-files)
2626
- [stru\_file](#stru_file)
2727
- [kpoint\_file](#kpoint_file)
@@ -224,6 +224,8 @@
224224
- [of\_ml\_q](#of_ml_q)
225225
- [of\_ml\_tanhp](#of_ml_tanhp)
226226
- [of\_ml\_tanhq](#of_ml_tanhq)
227+
- [of\_ml\_chi\_p](#of_ml_chi_p)
228+
- [of\_ml\_chi\_q](#of_ml_chi_q)
227229
- [of\_ml\_gammanl](#of_ml_gammanl)
228230
- [of\_ml\_pnl](#of_ml_pnl)
229231
- [of\_ml\_qnl](#of_ml_qnl)
@@ -234,8 +236,6 @@
234236
- [of\_ml\_tanh\_qnl](#of_ml_tanh_qnl)
235237
- [of\_ml\_tanhp\_nl](#of_ml_tanhp_nl)
236238
- [of\_ml\_tanhq\_nl](#of_ml_tanhq_nl)
237-
- [of\_ml\_chi\_p](#of_ml_chi_p)
238-
- [of\_ml\_chi\_q](#of_ml_chi_q)
239239
- [of\_ml\_chi\_xi](#of_ml_chi_xi)
240240
- [of\_ml\_chi\_pnl](#of_ml_chi_pnl)
241241
- [of\_ml\_chi\_qnl](#of_ml_chi_qnl)
@@ -1236,6 +1236,7 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12361236
- **Type**: Real
12371237
- **Description**: It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. Usually for local orbitals, usually 1e-6 may be accurate enough.
12381238
- **Default**: 1.0e-9 (plane-wave basis), or 1.0e-7 (localized atomic orbital basis).
1239+
- **Unit**: Ry if `scf_thr_type=1`, **dimensionless** if `scf_thr_type=2`
12391240

12401241
### scf_ene_thr
12411242

@@ -1248,10 +1249,8 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12481249

12491250
- **Type**: Integer
12501251
- **Description**: Choose the calculation method of convergence criterion.
1251-
- **1**: the criterion is defined as $\Delta\rho_G = \frac{1}{2}\iint{\frac{\Delta\rho(r)\Delta\rho(r')}{|r-r'|}d^3r d^3r'}$.
1252-
- **2**: the criterion is defined as $\Delta\rho_R = \frac{1}{N_e}\int{|\Delta\rho(r)|d^3r}$, where $N_e$ is the number of electron.
1253-
1254-
Note: This parameter is still under testing and the default setting is usually sufficient.
1252+
- **1**: the criterion is defined as $\Delta\rho_G = \frac{1}{2}\iint{\frac{\Delta\rho(r)\Delta\rho(r')}{|r-r'|}d^3r d^3r'}$, which is used in SCF of PW basis with unit Ry.
1253+
- **2**: the criterion is defined as $\Delta\rho_R = \frac{1}{N_e}\int{|\Delta\rho(r)|d^3r}$, where $N_e$ is the number of electron, which is used in SCF of LCAO with unit **dimensionless**.
12551254

12561255
- **Default**: 1 (plane-wave basis), or 2 (localized atomic orbital basis).
12571256

docs/advanced/interface/ase.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
```bash
1010
git clone https://gitlab.com/1041176461/ase-abacus.git
1111
cd ase-abacus
12-
python3 setup.py install
12+
pip install .
13+
```
14+
15+
Another direct way:
16+
```bash
17+
pip install git+https://gitlab.com/1041176461/ase-abacus.git
1318
```
1419

1520
## Environment variables
@@ -25,6 +30,8 @@ python3 setup.py install
2530

2631
For PW calculations, only `ABACUS_PP_PATH` is needed. For LCAO calculations, both `ABACUS_PP_PATH` and `ABACUS_ORBITAL_PATH` should be set.
2732

33+
Also, one can manally set the paths of PP and ORB when using ABACUS calculator in ASE.
34+
2835
## ABACUS Calculator
2936

3037
The default initialization command for the ABACUS calculator is
@@ -49,22 +56,41 @@ For more information on pseudopotentials and numerical orbitals, please visit [A
4956

5057
The input parameters can be set like::
5158
```python
52-
calc = Abacus(profile=profile, ntype=1, ecutwfc=50, scf_nmax=50, smearing_method='gaussian', smearing_sigma=0.01, basis_type='pw', ks_solver='cg', calculation='scf' pp=pp, basis=basis, kpts=kpts)
59+
# for ABACUS calculator
60+
calc = Abacus(profile=profile,
61+
ecutwfc=100,
62+
scf_nmax=100,
63+
smearing_method='gaussian',
64+
smearing_sigma=0.01,
65+
basis_type='pw',
66+
ks_solver='dav',
67+
calculation='scf',
68+
pp=pp,
69+
basis=basis,
70+
kpts=kpts)
5371
```
5472

5573
The command to run jobs can be set by specifying `AbacusProfile`::
5674

5775
```python
5876
from ase.calculators.abacus import AbacusProfile
59-
abacus = '/usr/local/bin/abacus'
60-
profile = AbacusProfile(argv=['mpirun','-n','2',abacus])
77+
# for OpenMP setting inside python env
78+
import os
79+
os.environ("OMP_NUM_THREADS") = 1
80+
# for MPI setting used in abacus
81+
mpi_num = 4
82+
# for ABACUS Profile
83+
abacus = '/usr/local/bin/abacus' # specify abacus exec
84+
profile = AbacusProfile(command=f'mpirun -n {mpi_num} {abacus}') # directly the command for running ABACUS
6185
```
6286

6387
in which `abacus` sets the absolute path of the `abacus` executable.
6488

6589
## MD Analysis
6690
After molecular dynamics calculations, the log file `running_md.log` can be read. If the 'STRU_MD_*' files are not continuous (e.g. 'STRU_MD_0', 'STRU_MD_5', 'STRU_MD_10'...), the index parameter of read should be as a slice object. For example, when using the command `read('running_md.log', index=slice(0, 15, 5), format='abacus-out')` to parse 'running_md.log', 'STRU_MD_0', 'STRU_MD_5' and 'STRU_MD_10' will be read.
6791

92+
The `MD_dump` file is also supported to be read-in by `read('MD_dump', format='abacus-md')`
93+
6894

6995
## SPAP Analysis
7096

docs/quick_start/input.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ Below is an example `INPUT` file with some of the most important parameters that
1010

1111
```plaintext
1212
INPUT_PARAMETERS
13-
suffix MgO
14-
ntype 2
15-
pseudo_dir ./
16-
orbital_dir ./
13+
suffix MgO # the output files will be in OUT.{suffix} directory
14+
pseudo_dir ./ # where the pseudopotential for each element is
15+
orbital_dir ./ # where the orbital file for each element is
1716
ecutwfc 100 # in Rydberg
18-
scf_thr 1e-4 # Rydberg
19-
basis_type lcao
17+
scf_thr 1e-6 # dimensionless for LCAO, Rydberg for PW. See documents for details.
18+
basis_type lcao # lcao or pw
2019
calculation scf # this is the key parameter telling abacus to do a scf calculation
21-
out_chg True
20+
out_chg 0 # only output binary charge file for restart
2221
```
2322

2423
The parameter list always starts with key word `INPUT_PARAMETERS`. Any content before `INPUT_PARAMETERS` will be ignored.
@@ -36,19 +35,18 @@ Furthermore, if a given parameter name appeared more than once in the input file
3635
3736
In the above example, the meanings of the parameters are:
3837

39-
- `suffix` : the name of the system, default `ABACUS`
40-
- `ntype` : how many types of elements in the unit cell
41-
- `pseudo_dir` : the directory where pseudopotential files are provided
42-
- `orbital_dir` : the directory where orbital files are provided
43-
- `ecutwfc` : the plane-wave energy cutoff for the wave function expansion (UNIT: Rydberg)
44-
- `scf_thr` : the threshold for the convergence of charge density (UNIT: Rydberg)
45-
- `basis_type` : the type of basis set for expanding the electronic wave functions
38+
- `suffix` : the name of the system, default `ABACUS`, and output files will be in OUT.{suffix} directory.
39+
- `pseudo_dir` : the directory where pseudopotential files are provided.
40+
- `orbital_dir` : the directory where orbital files are provided.
41+
- `ecutwfc` : the plane-wave energy cutoff for the wave function expansion (UNIT: Rydberg).
42+
- `scf_thr` : the threshold for the convergence of charge density (UNIT: Rydberg for PW, dimensionless for LCAO), we recommend `1e-7` for LCAO and `1e-9` for PW basis.
43+
- `basis_type` : the type of basis set for expanding the electronic wave functions, one can set lcao or pw.
4644
- `calculation` : the type of calculation to be performed by ABACUS
47-
- `out_chg` : if true, output the charge density on real space grid
45+
- `out_chg` : setting for output the charge density in real space grid, -1 for no output, 0 for binary output, 1 for binary and cube output.
4846

4947
For a complete list of input parameters, please consult this [instruction](../advanced/input_files/input-main.md).
5048

51-
> **Note:** Users cannot change the filename “INPUT” to other names. Boolean paramerters such as `out_chg` can be set by using `True` and `False`, `1` and `0`, or `T` and `F`. It is case insensitive so that other preferences such as `true` and `false`, `TRUE` and `FALSE`, and `t` and `f` for setting boolean values are also supported. Specifically for the `out_chg`, `-1` option is also available, which means turn off the checkpoint of charge density in binary (always dumped in `OUT.{suffix}`, whose name ends with `CHARGE-DENSITY.restart`). Some parameters controlling the output also support a second option to control the output precision, e.g., `out_chg True 8` will output the charge density on realspace grid with 8 digits after the decimal point.
49+
> **Note:** Users cannot change the filename “INPUT” to other names. Boolean paramerters such as `out_chg` can be set by using `True` and `False`, `1` and `0`, or `T` and `F`. It is case insensitive so that other preferences such as `true` and `false`, `TRUE` and `FALSE`, and `t` and `f` for setting boolean values are also supported. Specifically for the `out_chg`, `-1` option is also available, which means turn off the checkpoint of charge density in binary (always dumped in `OUT.{suffix}`, whose name ends with `CHARGE-DENSITY.restart`). Some parameters controlling the output also support a second option to control the output precision, e.g., `out_chg 1 8` will output the charge density on realspace grid with 8 digits after the decimal point.
5250
5351
## *STRU*
5452

@@ -69,7 +67,8 @@ Mg_gga_8au_100Ry_4s2p1d.orb
6967
O_gga_8au_100Ry_2s2p1d.orb
7068
7169
LATTICE_CONSTANT
72-
1.8897259886 # 1.8897259886 Bohr = 1.0 Angstrom
70+
1.889726126 # 1.0 Ang = 1/a_0 = 1/0.529177210544
71+
# Bohr radius ref: https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0
7372
7473
LATTICE_VECTORS
7574
4.25648 0.00000 0.00000

0 commit comments

Comments
 (0)