forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge: Update DFT+U & documentation for DFT+U and Wannier90 interface…
… from abacusmodeling/abacus-develop/develop (#1326) * Fix: SOC calculation in PW code would caused nan * Fix: setting of k-points in NSPIN=2 has conflict with Pkpoints in numerical_basis.cpp * Fix: nscf with hybrid functional 'hse' or 'pbe0' or 'scan0' * Fix: generating orbitals outputs with nspin=2 * Update the documents for DFT+U * Modify the help documents of wannier90 and berry phase Mainly modified Berry_phase.md and Wannier90.md in the docs/advanced/ folder. Adjusted the files in example/interface_wannier90. * Adjust the file in example/interface_wannier90. * Revise the error in the documents of DFT+U * Update docs/advanced/input_files/input-main.md Co-authored-by: Chun Cai <amoycaic@gmail.com> Co-authored-by: Qx80610702 <80610702@qq.com> Co-authored-by: jingan <jingan@mail.ustc.edu.cn> Co-authored-by: Chun Cai <amoycaic@gmail.com> Co-authored-by: Wenfei Li <38569667+wenfei-li@users.noreply.github.com>
- Loading branch information
1 parent
617bd3b
commit f0fa34b
Showing
21 changed files
with
3,993 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,121 @@ | ||
# Wannier90 | ||
# Wannier90 | ||
|
||
[Wannier90](http://www.wannier.org/) is a useful package to generating the maximally-localized Wannier functions (MLWFs), which can be used to compute advanced electronic properties. Some post-processing tools (such as WannierTools, etc.) will use MLWFs for further analysis and calculations. | ||
|
||
Currently ABACUS provides an interface to Wannier90 package. The users are assumed to be familiar with the use of Wannier90. The ABACUS-Wannier90 interface is only suitable for nspin=1 or 2, not for nspin=4 or spin-orbit coupling (SOC). | ||
|
||
To construct the MLWFs using the wave functions of ABACUS generally requires four steps. Here we use the diamond as an example which can be found in [examples/interface_wannier90/](https://github.com/abacusmodeling/abacus-develop/tree/develop/examples/interface_wannier90). | ||
|
||
1. Enter the `ABACUS_towannier90/` folder, prepare a Wannier90 input file `diamond.win`, which is the main input file for Wannier90. Then To generate `diamond.nnkp` file by running Wannier90, which ABACUS will read later: | ||
|
||
``` | ||
wannier90 -pp diamond.win | ||
``` | ||
|
||
The content of `diamond.win` is as follows: | ||
|
||
``` | ||
num_wann = 4 | ||
num_iter = 20 | ||
wannier_plot=.true. | ||
wannier_plot_supercell = 3 | ||
wvfn_formatted = .true. | ||
begin atoms_frac | ||
C -0.12500 -0.1250 -0.125000 | ||
C 0.12500 0.1250 0.125000 | ||
end atoms_frac | ||
begin projections | ||
f=0.0,0.0,0.0:s | ||
f=0.0,0.0,0.5:s | ||
f=0.0,0.5,0.0:s | ||
f=0.5,0.0,0.0:s | ||
end projections | ||
begin unit_cell_cart | ||
-1.613990 0.000000 1.613990 | ||
0.000000 1.613990 1.613990 | ||
-1.613990 1.613990 0.000000 | ||
end unit_cell_cart | ||
mp_grid : 4 4 4 | ||
begin kpoints | ||
0.0000 0.0000 0.0000 | ||
0.0000 0.2500 0.0000 | ||
0.0000 0.5000 0.0000 | ||
0.0000 0.7500 0.0000 | ||
... | ||
end kpoints | ||
``` | ||
|
||
2. Do a self-consistent calculation and get the converged charge density: | ||
|
||
``` | ||
cp INPUT-scf INPUT | ||
cp KPT-scf KPT | ||
mpirun -np 4 abacus | ||
``` | ||
|
||
|
||
3. Do a non-self-consistent calculation: | ||
|
||
``` | ||
cp INPUT-nscf INPUT | ||
cp KPT-nscf KPT | ||
mpirun -np 4 abacus | ||
``` | ||
|
||
below are the INPUT file (nscf): | ||
|
||
``` | ||
INPUT_PARAMETERS | ||
ntype 1 | ||
ecutwfc 50 | ||
nbands 4 | ||
calculation nscf | ||
scf_nmax 50 | ||
pw_diag_thr 1.0e-12 | ||
scf_thr 1.0e-15 | ||
init_chg file | ||
symmetry 0 | ||
towannier90 1 | ||
nnkpfile diamond.nnkp | ||
``` | ||
|
||
There are three interface-related parameters in the `INPUT` file: | ||
|
||
- [towannier90](../input_files/input-main.md#towannier90): `1`, generate files for wannier90 code; `0`, do not generate. | ||
- [nnkpfile](../input_files/input-main.md#nnkpfile) : the name of the file generated by running "wannier90 -pp ...". | ||
- [wannier_spin](../input_files/input-main.md#wannier_spin): If you use nspin=2, `up`: calculate the Wannier functions for the spin up components ; `down`: calculate the Wannier functions spin down components. | ||
|
||
Note: You need to turn off the symmetry during the entire nscf calculation. | ||
|
||
To setup the `KPT` file according to the `diamond.win` file, which is similar to "begin kpoints ..." in the `diamond.win` file: | ||
|
||
``` | ||
K_POINTS | ||
64 | ||
Direct | ||
0.0000 0.0000 0.0000 0.0156250 | ||
0.0000 0.2500 0.0000 0.0156250 | ||
0.0000 0.5000 0.0000 0.0156250 | ||
0.0000 0.7500 0.0000 0.0156250 | ||
... | ||
``` | ||
|
||
After the nscf calculation, ABACUS will generate `diamond.amn`, `diamond.mmn`, `diamond.eig`, `UNK` files in the `OUT.` folder which are input files needed by Wannier90 code. | ||
|
||
4. Copy `.amn`, `.mmn`, `.eig`, `UNK` file to `wannier/` folder, to get the MLWFs by running Wannier90: | ||
|
||
``` | ||
wannier90 diamond.win | ||
``` | ||
|
||
Notes: | ||
|
||
- The ABACUS-wannier90 interface can be used in both PW and LCAO basis. | ||
- If you want to plot the Wannier function, you must set `wvfn_formatted = .true.` in `diamond.win`, otherwise Wannier90 code cannot read files generated by ABACUS because these files are not binary files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
INPUT_PARAMETERS | ||
suffix NiO | ||
ntype 2 | ||
nbands 40 | ||
|
||
calculation scf | ||
ecutwfc 100 | ||
scf_thr 1.0e-6 | ||
scf_nmax 200 | ||
out_chg 1 | ||
|
||
#init_chg file | ||
#out_dos 1 | ||
#dos_sigma 0.07 | ||
#out_band 1 | ||
|
||
smearing_method gaussian | ||
smearing_sigma 0.05 | ||
|
||
|
||
mixing_type pulay | ||
mixing_beta 0.4 | ||
#mixing_gg0 1.5 | ||
|
||
ks_solver genelpa | ||
basis_type lcao | ||
gamma_only 0 | ||
symmetry 0 | ||
nspin 2 | ||
|
||
#Parameter DFT+U | ||
dft_plus_u 1 | ||
orbital_corr 2 2 -1 | ||
hubbard_u 5.0 5.0 0.0 | ||
hund_j 0.0 0.0 0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
K_POINTS | ||
0 | ||
Gamma | ||
7 7 7 0.0 0.0 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ATOMIC_SPECIES | ||
Ni1 1.000 ../../tests/PP_ORB/Ni_ONCV_PBE-1.0.upf | ||
Ni2 1.000 ../../tests/PP_ORB/Ni_ONCV_PBE-1.0.upf | ||
O 1.000 ../../tests/PP_ORB/O_ONCV_PBE-1.0.upf | ||
|
||
NUMERICAL_ORBITAL | ||
../../tests/PP_ORB/Ni_gga_9au_100Ry_4s2p2d1f.orb | ||
../../tests/PP_ORB/Ni_gga_9au_100Ry_4s2p2d1f.orb | ||
../../tests/PP_ORB/O_gga_7au_100Ry_2s2p1d.orb | ||
|
||
LATTICE_CONSTANT | ||
7.884 | ||
|
||
LATTICE_VECTORS | ||
1.00 0.50 0.50 | ||
0.50 1.00 0.50 | ||
0.50 0.50 1.00 | ||
ATOMIC_POSITIONS | ||
Direct | ||
|
||
Ni1 | ||
2.0 | ||
1 | ||
0.00 0.00 0.00 1 1 1 | ||
|
||
Ni2 | ||
-2.0 | ||
1 | ||
0.50 0.50 0.50 1 1 1 | ||
|
||
O | ||
0.0 | ||
2 | ||
0.25 0.25 0.25 1 1 1 | ||
0.75 0.75 0.75 1 1 1 |
22 changes: 12 additions & 10 deletions
22
examples/interface_wannier90/ABACUS_towannier90/INPUT-nscf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
INPUT_PARAMETERS | ||
|
||
ntype 1 | ||
ecutwfc 40 | ||
nbands 4 | ||
calculation nscf | ||
scf_nmax 40 | ||
pw_diag_thr 1.0e-12 | ||
scf_thr 1.0e-15 | ||
init_chg file | ||
out_band 1 | ||
pseudo_dir ../../../tests/PP_ORB | ||
orbital_dir ../../../tests/PP_ORB | ||
ntype 1 | ||
ecutwfc 50 | ||
nbands 4 | ||
calculation nscf | ||
scf_nmax 50 | ||
pw_diag_thr 1.0e-12 | ||
scf_thr 1.0e-15 | ||
init_chg file | ||
symmetry 0 | ||
towannier90 1 | ||
nnkpfile seedname.nnkp | ||
nnkpfile diamond.nnkp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
INPUT_PARAMETERS | ||
|
||
ntype 1 | ||
ecutwfc 40 | ||
pseudo_dir ../../../tests/PP_ORB | ||
orbital_dir ../../../tests/PP_ORB | ||
ntype 1 | ||
ecutwfc 50 | ||
calculation scf | ||
scf_thr 1e-13 | ||
out_chg 1 | ||
scf_thr 1e-13 | ||
out_chg 1 |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ABACUS to wannier90 step: | ||
|
||
1. You need a wannier90 input file `diamond.win`. then,you should run `wannier90 -pp diamond.win` and you will get `diamond.nnkp` file that is the necessary file for ABACUS. | ||
2. Prepare ABACUS's `INPUT`, `STRU`, `KPT`, pseudopotential file, `diamond.nnkp` file. Especially pay attention to kpt file in nscf calculation. | ||
3. First, you should do scf calculation, just like you always do. This step doesn't need `diamond.nnkp` file. Second, you should do nscf calculation, the kpt file is similar to "begin kpoints ..." in the `diamond.win` file. | ||
4. After you run ABACUS nscf calculation, you will get `diamond.amn`, `diamond.mmn` and `UNK*` file in OUT.* folder. | ||
5. Copy `diamond.amn`, `diamond.mmn`, `UNK*` file to wannier folder, then you can run `wannier90 diamond.win`, and you will get MLWF. There is a important things, you must set `wvfn_formatted = .true.` in `diamond.win`, otherwise the wannier90 code cannot read ABACUS file. |
Oops, something went wrong.