Skip to content

Commit 2260530

Browse files
authored
Remove useless and outdated write_psi_r_1 interface and improve related docs and examples (#6345)
* Update docs related to wfc and modify examples * Remove write_psi_r_1 interface from ABACUS
1 parent e7917d4 commit 2260530

File tree

35 files changed

+195
-464
lines changed

35 files changed

+195
-464
lines changed
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Extracting Wave Functions
22

3-
ABACUS is able to output electron wave functions in both PW and LCAO basis calculations. One can find the examples in [examples/wfc](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/wfc).
3+
ABACUS is able to output electron wave functions in both PW and LCAO basis calculations. One can find the examples in [examples/11_wfc](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/11_wfc).
44

5-
## wave function in G space
6-
For the wave function in G space, one only needs to do a ground-state energy calculation with one additional keyword in the INPUT file: '***[out_wfc_pw](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-pw)***' for PW basis calculation, and '***[out_wfc_lcao](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-lcao)***' for LCAO basis calculation.
7-
In the PW basis case, the wave function is output in a file called `WAVEFUNC${k}.txt`, where `${k}` is the index of K point. \
8-
In the LCAO basis case, several `WFC_NAO_K${k}.dat` files will be output in multi-k calculation and `WFC_NAO_GAMMA1.dat` in gamma-only calculation.
5+
## Wave Function in G-Space
96

10-
## wave function in real space
7+
To output wave functions in G-space, add one of the following keywords to the `INPUT` file while performing SCF calculation:
8+
- **PW basis**: Set [`out_wfc_pw`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-pw) to `1`. Output file format: `wfs[spin]k[kpoint]_pw.txt`, where `[spin]` is the spin channel index, and `[kpoint]` the k-point index.
119

12-
One can also choose to output real-space wave function in PW basis calculation with the key word ***[out_wfc_norm](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-norm)***.
10+
- **LCAO basis**: Set [`out_wfc_lcao`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-lcao) to `1`.
11+
- **Multi-k calculations**: Generates multiple files `wfs[spin]k[kpoint]_nao.txt`.
12+
- **Gamma-only calculations**: `wfs[spin]_nao.txt` instead.
1313

14-
Notice: when the ***[basis_type](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#basis_type)*** is `lcao`, only `get_wf` ***[calculation](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#calculation)*** is effective. An example is [examples/wfc/lcao_ienvelope_Si2](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/wfc/lcao_ienvelope_Si2).
14+
## Wave Function in Real Space
15+
16+
One can also choose to output real-space wave functions with the keyword [`out_wfc_norm`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-norm) or [`out_wfc_re_im`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-re-im).
17+
18+
Notice: When the [`basis_type`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#basis-type) is `lcao`, only `get_wf` [`calculation`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#calculation) is effective. An example is [examples/11_wfc/lcao_ienvelope_Si2](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/11_wfc/lcao_ienvelope_Si2).

docs/advanced/input_files/input-main.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ These variables are used to control the output of properties.
17031703

17041704
- **Type**: Boolean
17051705
- **Availability**: Numerical atomic orbital basis (multi-k points)
1706-
- **Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
1706+
- **Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optional 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
17071707
- nspin = 1: `dmrs1_nao.csr`;
17081708
- nspin = 2: `dmrs1_nao.csr` and `dmrs2_nao.csr` for the two spin channels.
17091709
- **Default**: False
@@ -1726,7 +1726,7 @@ These variables are used to control the output of properties.
17261726

17271727
- **Type**: Integer
17281728
- **Availability**: Numerical atomic orbital basis
1729-
- **Description**: Whether to output the electronic wavefunction coefficients into files and store them in the folder `OUT.${suffix}`. The files are named as `wf{s}{spin index}{k(optinal)}{k-point index}{g(optional)}{geometry index1}{_nao} + {".txt"/".dat"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and 's12' refer to spinor wave functions that contains both spin channels with spin-orbital coupling or noncollinear calculations enabled. In addition, if 'gamma_only' is set to 0, then the optinoal k-point sampling index appears with the k-point index attached to the electronic wave function file names. Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the wave functions accumulate during ionic steps.
1729+
- **Description**: Whether to output the electronic wavefunction coefficients into files and store them in the folder `OUT.${suffix}`. The files are named as `wf{s}{spin index}{k(optional)}{k-point index}{g(optional)}{geometry index1}{_nao} + {".txt"/".dat"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and 's12' refer to spinor wave functions that contains both spin channels with spin-orbital coupling or noncollinear calculations enabled. In addition, if 'gamma_only' is set to 0, then the optinoal k-point sampling index appears with the k-point index attached to the electronic wave function file names. Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optional 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the wave functions accumulate during ionic steps.
17301730
- 0: no output
17311731
- 1: (txt format)
17321732
- gamma-only: `wfs1_nao.txt` or `wfs2_nao.txt`, ...;

examples/08_charge_density/lcao_nspin1_Si2/INPUT

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
44
orbital_dir ../../../tests/PP_ORB
5-
calculation scf
5+
calculation scf
66
nbands 8
7-
#Parameters (Methos)
7+
#Parameters (Methods)
88
basis_type lcao
9-
symmetry 0
9+
symmetry 0
1010
#Parameters (Accuracy)
11-
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
11+
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
1212
scf_thr 1.0e-7 // about iteration
13-
scf_nmax 100
13+
scf_nmax 100
1414
#Parameters (File)
1515
out_chg 1
1616

examples/08_charge_density/pw_nspin1_Al/INPUT

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
4-
calculation scf
4+
calculation scf
55
symmetry 0
6-
#Parameters (Methos)
6+
#Parameters (Methods)
77
basis_type pw
8-
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
8+
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
99
scf_thr 1.0e-8 // about iteration
10-
scf_nmax 100
11-
smearing_method gauss
12-
smearing_sigma 0.01
10+
scf_nmax 100
11+
smearing_method gauss
12+
smearing_sigma 0.01
1313
#Parameters (File)
1414
out_chg 1
1515

examples/09_density_matrix/lcao_nspin1_Si2/INPUT

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
44
orbital_dir ../../../tests/PP_ORB
5-
calculation scf
5+
calculation scf
66
nbands 16
7-
#Parameters (Methos)
7+
#Parameters (Methods)
88
basis_type lcao
9-
symmetry 0
9+
symmetry 0
1010
#Parameters (Accuracy)
11-
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
11+
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
1212
scf_thr 1.0e-7 // about iteration
13-
scf_nmax 100
13+
scf_nmax 100
1414
#Parameters (File)
15-
gamma_only 1
15+
gamma_only 1
1616
out_dmk 1
1717

1818

examples/11_wfc/README

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
These examples show how to output the wavefunction in G space.
2-
For PW basis:
3-
- set 'out_wfc_pw' to '1'
4-
The wave function is output in a file called 'WAVEFUNC1.txt'
1+
These examples demonstrate how to output wave functions in G-space and real space.
52

6-
For LCAO basis:
7-
- set 'out_wfc_lcao' to '1'
8-
Several `WFC_NAO_K#.txt` files will be output in multi-k calculation and
9-
`WFC_NAO_GAMMA1.txt` in gamma-only calculation.
3+
For Plane-Wave (PW) Basis:
4+
- Set `out_wfc_pw = 1`.
5+
The wave functions will be output to a series of files named `wfs[spin]k[kpoint]_pw.txt`.
106

7+
For LCAO Basis:
8+
- Set `out_wfc_lcao = 1`.
9+
In multi-k calculations, multiple files named `wfs[spin]k[kpoint]_nao.txt` will be generated.
10+
In gamma-only calculations, `wfs[spin]_nao.txt` instead.
1111

12-
For the wave functions in Real Space:
13-
- set 'out_wfc_r' to '1'
14-
The wave function is output in files OUT.${suffix}/wfc_realspace/wfc_realspace_$K_$B,
15-
where $K and $B is the index of k point and band respectively.
16-
Note, it is only used in planewave basis and get_wf calculation in localized orbitals set
12+
For Wave Functions in Real Space:
13+
- Set either `out_wfc_norm` or `out_wfc_re_im` to a space-separated string of 0s and 1s.
14+
- E.g.: `1 0 0 0 0 1 1 1 1 1 0`, or `1 4*0 5*1 0` for short.
15+
The wave functions will be output to files named `wfi[state]s[spin]k[kpoint][re/im].cube`.
16+
Note, it is only supported for PW basis and `get_wf` calculation under LCAO basis.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
44
orbital_dir ../../../tests/PP_ORB
55
calculation scf
66
ntype 1
77
nbands 8
8-
#Parameters (Methos)
8+
#Parameters (Methods)
99
basis_type lcao
1010
symmetry 0
1111
#Parameters (Accuracy)
1212
ecutwfc 50
1313
scf_thr 1.0e-7 // about iteration
14-
scf_nmax 100
14+
scf_nmax 100
1515
#Parameters (File)
16-
out_wfc_lcao 1
16+
out_wfc_lcao 1
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
44
orbital_dir ../../../tests/PP_ORB
55
calculation get_wf
66
nbands 8
7-
#Parameters (Methos)
7+
#Parameters (Methods)
88
basis_type lcao
99
symmetry 0
1010
#Parameters (Accuracy)
1111
ecutwfc 50
1212
#Parameters (File)
13-
init_wfc file
14-
out_wfc_r 1
13+
init_wfc file
14+
out_wfc_norm 4*1

examples/11_wfc/lcao_ienvelope_Si2/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if [[ ! -f scf.output ]] ||
1515
[[ ! -f get_wf.output ]] ||
1616
[[ ! -f OUT.ABACUS/running_scf.log ]] ||
1717
[[ ! -f OUT.ABACUS/running_get_wf.log ]] ||
18-
[[ ! -f OUT.ABACUS/WFC_NAO_K1.txt ]] ||
19-
[[ ! -f OUT.ABACUS/WFC_NAO_K36.txt ]] ||
18+
[[ ! -f OUT.ABACUS/wfs1k1_nao.txt ]] ||
19+
[[ ! -f OUT.ABACUS/wfs1k36_nao.txt ]] ||
2020
[[ ! ( "$(tail -1 OUT.ABACUS/running_scf.log)" == " Total Time :"* ) ]] ||
2121
[[ ! ( "$(tail -1 OUT.ABACUS/running_get_wf.log)" == " Total Time :"* ) ]]
2222
then

examples/11_wfc/lcao_scf_Si2/INPUT

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
INPUT_PARAMETERS
2-
#Parameters (General)
2+
#Parameters (General)
33
pseudo_dir ../../../tests/PP_ORB
44
orbital_dir ../../../tests/PP_ORB
55
calculation scf
66
nbands 8
7-
#Parameters (Methos)
7+
#Parameters (Methods)
88
basis_type lcao
99
symmetry 0
1010
#Parameters (Accuracy)
11-
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
11+
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
1212
scf_thr 1.0e-7 // about iteration
13-
scf_nmax 100
13+
scf_nmax 100
1414
#Parameters (File)
15-
out_wfc_lcao 1
15+
out_wfc_lcao 1
1616

1717

1818
### [1] Energy cutoff determines the quality of numerical quadratures in your calculations.

0 commit comments

Comments
 (0)