Skip to content

Commit

Permalink
Refactor: update toWannier90 interface with psi_initializer_nao (#3…
Browse files Browse the repository at this point in the history
…371)

* produce wrong results, will debug

* implement lcao_in_pw

* debug compile error of unittest

* ecutwfc 20 is not compatible with mpirun -np 4, dont know why

* add unittest for newly-added lcao_in_pw specific HSolver::solve

* correct index of psig when passing values

* initialize bx by and bz of INPUT so that elimiate undefined behavior

* correct psi_initializer, allocate appropriate memory for psi. Delete redundant code in psi_initializer_nao

* - avoid initial scf converting psig to psi when lcao_in_pw,
- add normalization of psig when init_wfc = nao
- correct timer of diagH_subspace_init function

* add MPI reduce and add unit test on nspin = 4 case

* repair hsolverPW::solve

* repair paw part of lcao_in_pw specific HSolverPW::solve

* update towannier90 interface with psi_initializer

* recover the LCAO macro

* update unittest of input_test

* correct unittest

---------

Co-authored-by: Zhao Tianqi <hongriTianqi@users.noreply.github.com>
Co-authored-by: dyzheng <zhengdy@dp.tech>
  • Loading branch information
3 people authored Dec 25, 2023
1 parent 23b809c commit 8c9edbf
Show file tree
Hide file tree
Showing 17 changed files with 1,039 additions and 108 deletions.
6 changes: 3 additions & 3 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
- [mixing\_gg0](#mixing_gg0)
- [mixing\_gg0\_mag](#mixing_gg0_mag)
- [mixing\_gg0\_min](#mixing_gg0_min)
- [mixing\_angle](#mixing_angle)
- [mixing\_tau](#mixing_tau)
- [mixing\_dftu](#mixing_dftu)
- [mixing\_angle](#mixing_angle)
- [gamma\_only](#gamma_only)
- [printe](#printe)
- [scf\_nmax](#scf_nmax)
Expand Down Expand Up @@ -876,7 +876,7 @@ calculations.
- **Description**: Choose the basis set.
- **pw**: Using plane-wave basis set only.
- **lcao**: Using localized atomic orbital sets.
- **lcao_in_pw**: (Unavailable currently, it will be fixed in future versions) Expand the localized atomic set in plane-wave basis.
- **lcao_in_pw**: Expand the localized atomic set in plane-wave basis, non-self-consistent field calculation not tested.
- **Default**: pw

### ks_solver
Expand Down Expand Up @@ -2746,7 +2746,7 @@ These variables are used to control berry phase and wannier90 interface paramete

- **Type**: Integer
- **Description**: Only available on LCAO basis, using different methods to generate "\*.mmn" file and "\*.amn" file.
- 1: Calculated using the LCOA-in-PW method, the calculation accuracy can be improved by increasing `ecutwfc` to maintain consistency with the pw basis set results.
- 1: Calculated using the `lcao_in_pw` method, the calculation accuracy can be improved by increasing `ecutwfc` to maintain consistency with the pw basis set results.
- 2: The overlap between atomic orbitals is calculated using grid integration. The radial grid points are generated using the Gauss-Legendre method, while the spherical grid points are generated using the Lebedev-Laikov method.
- **Default**: 1

Expand Down
18 changes: 18 additions & 0 deletions examples/interface_wannier90/ABACUS_towannier90_lcao_in_pw/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
INPUT_PARAMETERS

pseudo_dir ../../../tests/PP_ORB
orbital_dir ../../../tests/PP_ORB
ntype 1
ecutwfc 50
nbands 12
calculation nscf
scf_nmax 50
pw_diag_thr 1.0e-12
scf_thr 1.0e-15
init_chg file
symmetry 0
towannier90 1
wannier_method 1
nnkpfile diamond.nnkp
basis_type lcao

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
INPUT_PARAMETERS

pseudo_dir ../../../tests/PP_ORB
orbital_dir ../../../tests/PP_ORB
ntype 1
ecutwfc 50
nbands 12
calculation nscf
scf_nmax 50
pw_diag_thr 1.0e-12
scf_thr 1.0e-15
init_chg file
symmetry 0
towannier90 1
wannier_method 1
nnkpfile diamond.nnkp
basis_type lcao

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
INPUT_PARAMETERS

pseudo_dir ../../../tests/PP_ORB
orbital_dir ../../../tests/PP_ORB
ntype 1
ecutwfc 50
calculation scf
scf_thr 1e-13
out_chg 1
basis_type lcao_in_pw
ks_solver lapack
67 changes: 67 additions & 0 deletions examples/interface_wannier90/ABACUS_towannier90_lcao_in_pw/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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
0.2500 0.0000 0.0000 0.0156250
0.2500 0.2500 0.0000 0.0156250
0.2500 0.5000 0.0000 0.0156250
0.2500 0.7500 0.0000 0.0156250
0.5000 0.0000 0.0000 0.0156250
0.5000 0.2500 0.0000 0.0156250
0.5000 0.5000 0.0000 0.0156250
0.5000 0.7500 0.0000 0.0156250
0.7500 0.0000 0.0000 0.0156250
0.7500 0.2500 0.0000 0.0156250
0.7500 0.5000 0.0000 0.0156250
0.7500 0.7500 0.0000 0.0156250
0.0000 0.0000 0.2500 0.0156250
0.0000 0.2500 0.2500 0.0156250
0.0000 0.5000 0.2500 0.0156250
0.0000 0.7500 0.2500 0.0156250
0.2500 0.0000 0.2500 0.0156250
0.2500 0.2500 0.2500 0.0156250
0.2500 0.5000 0.2500 0.0156250
0.2500 0.7500 0.2500 0.0156250
0.5000 0.0000 0.2500 0.0156250
0.5000 0.2500 0.2500 0.0156250
0.5000 0.5000 0.2500 0.0156250
0.5000 0.7500 0.2500 0.0156250
0.7500 0.0000 0.2500 0.0156250
0.7500 0.2500 0.2500 0.0156250
0.7500 0.5000 0.2500 0.0156250
0.7500 0.7500 0.2500 0.0156250
0.0000 0.0000 0.5000 0.0156250
0.0000 0.2500 0.5000 0.0156250
0.0000 0.5000 0.5000 0.0156250
0.0000 0.7500 0.5000 0.0156250
0.2500 0.0000 0.5000 0.0156250
0.2500 0.2500 0.5000 0.0156250
0.2500 0.5000 0.5000 0.0156250
0.2500 0.7500 0.5000 0.0156250
0.5000 0.0000 0.5000 0.0156250
0.5000 0.2500 0.5000 0.0156250
0.5000 0.5000 0.5000 0.0156250
0.5000 0.7500 0.5000 0.0156250
0.7500 0.0000 0.5000 0.0156250
0.7500 0.2500 0.5000 0.0156250
0.7500 0.5000 0.5000 0.0156250
0.7500 0.7500 0.5000 0.0156250
0.0000 0.0000 0.7500 0.0156250
0.0000 0.2500 0.7500 0.0156250
0.0000 0.5000 0.7500 0.0156250
0.0000 0.7500 0.7500 0.0156250
0.2500 0.0000 0.7500 0.0156250
0.2500 0.2500 0.7500 0.0156250
0.2500 0.5000 0.7500 0.0156250
0.2500 0.7500 0.7500 0.0156250
0.5000 0.0000 0.7500 0.0156250
0.5000 0.2500 0.7500 0.0156250
0.5000 0.5000 0.7500 0.0156250
0.5000 0.7500 0.7500 0.0156250
0.7500 0.0000 0.7500 0.0156250
0.7500 0.2500 0.7500 0.0156250
0.7500 0.5000 0.7500 0.0156250
0.7500 0.7500 0.7500 0.0156250
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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
0.2500 0.0000 0.0000 0.0156250
0.2500 0.2500 0.0000 0.0156250
0.2500 0.5000 0.0000 0.0156250
0.2500 0.7500 0.0000 0.0156250
0.5000 0.0000 0.0000 0.0156250
0.5000 0.2500 0.0000 0.0156250
0.5000 0.5000 0.0000 0.0156250
0.5000 0.7500 0.0000 0.0156250
0.7500 0.0000 0.0000 0.0156250
0.7500 0.2500 0.0000 0.0156250
0.7500 0.5000 0.0000 0.0156250
0.7500 0.7500 0.0000 0.0156250
0.0000 0.0000 0.2500 0.0156250
0.0000 0.2500 0.2500 0.0156250
0.0000 0.5000 0.2500 0.0156250
0.0000 0.7500 0.2500 0.0156250
0.2500 0.0000 0.2500 0.0156250
0.2500 0.2500 0.2500 0.0156250
0.2500 0.5000 0.2500 0.0156250
0.2500 0.7500 0.2500 0.0156250
0.5000 0.0000 0.2500 0.0156250
0.5000 0.2500 0.2500 0.0156250
0.5000 0.5000 0.2500 0.0156250
0.5000 0.7500 0.2500 0.0156250
0.7500 0.0000 0.2500 0.0156250
0.7500 0.2500 0.2500 0.0156250
0.7500 0.5000 0.2500 0.0156250
0.7500 0.7500 0.2500 0.0156250
0.0000 0.0000 0.5000 0.0156250
0.0000 0.2500 0.5000 0.0156250
0.0000 0.5000 0.5000 0.0156250
0.0000 0.7500 0.5000 0.0156250
0.2500 0.0000 0.5000 0.0156250
0.2500 0.2500 0.5000 0.0156250
0.2500 0.5000 0.5000 0.0156250
0.2500 0.7500 0.5000 0.0156250
0.5000 0.0000 0.5000 0.0156250
0.5000 0.2500 0.5000 0.0156250
0.5000 0.5000 0.5000 0.0156250
0.5000 0.7500 0.5000 0.0156250
0.7500 0.0000 0.5000 0.0156250
0.7500 0.2500 0.5000 0.0156250
0.7500 0.5000 0.5000 0.0156250
0.7500 0.7500 0.5000 0.0156250
0.0000 0.0000 0.7500 0.0156250
0.0000 0.2500 0.7500 0.0156250
0.0000 0.5000 0.7500 0.0156250
0.0000 0.7500 0.7500 0.0156250
0.2500 0.0000 0.7500 0.0156250
0.2500 0.2500 0.7500 0.0156250
0.2500 0.5000 0.7500 0.0156250
0.2500 0.7500 0.7500 0.0156250
0.5000 0.0000 0.7500 0.0156250
0.5000 0.2500 0.7500 0.0156250
0.5000 0.5000 0.7500 0.0156250
0.5000 0.7500 0.7500 0.0156250
0.7500 0.0000 0.7500 0.0156250
0.7500 0.2500 0.7500 0.0156250
0.7500 0.5000 0.7500 0.0156250
0.7500 0.7500 0.7500 0.0156250
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Gamma
12 12 12 0 0 0
21 changes: 21 additions & 0 deletions examples/interface_wannier90/ABACUS_towannier90_lcao_in_pw/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ATOMIC_SPECIES
C 12.000 C.LDA.UPF

NUMERICAL_ORBITAL
C_lda_8.0au_100Ry_2s2p1d.orb

LATTICE_CONSTANT
6.1

LATTICE_VECTORS
-0.5 0.0 0.5
0.0 0.5 0.5
-0.5 0.5 0.0

ATOMIC_POSITIONS
Direct
C
0.0
2
0.875 0.875 0.875 0 0 0
0.125 0.125 0.125 0 0 0
Loading

0 comments on commit 8c9edbf

Please sign in to comment.