Skip to content

Commit

Permalink
Fix: enable out_mat_r in nscf calculation (#4084)
Browse files Browse the repository at this point in the history
* Fix: enable out_mat_r in nscf calculation

* add test case 207_NO_KP_OH_nscf

* fix: out_mat_dh will modify out_mat_r

---------

Co-authored-by: dyzheng <zhengdy@bjaisi.com>
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
  • Loading branch information
3 people committed May 15, 2024
1 parent b5ac150 commit cc96be0
Show file tree
Hide file tree
Showing 11 changed files with 4,767 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/module_esolver/esolver_ks_lcao_elec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,9 @@ void ESolver_KS_LCAO<TK, TR>::nscf(void)
GlobalC::ld.cal_gedm(GlobalC::ucell.nat);
}
#endif

this->create_Output_Mat_Sparse(0).write();

return;
}

Expand Down
37 changes: 37 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
INPUT_PARAMETERS
#Parameters (1.General)
suffix autotest
calculation nscf

nbands 6
symmetry 0
pseudo_dir ../../PP_ORB
orbital_dir ../../PP_ORB
read_file_dir ./
gamma_only 0

#Parameters (2.Iteration)
ecutwfc 20
scf_thr 1e-8
scf_nmax 100

#out_chg 1
init_chg file
out_mat_hs2 1
out_mat_r 1
out_mat_t 1
pw_diag_thr 0.00001

#Parameters (3.Basis)
basis_type lcao

#Parameters (4.Smearing)
smearing_method gauss
smearing_sigma 0.002

#Parameters (5.Mixing)
mixing_type broyden
mixing_beta 0.7
mixing_gg0 1.5

ks_solver scalapack_gvx
5 changes: 5 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
K_POINTS
2
Line
0.5 0.5 0.5 5
0.0 0.0 0.0 1
2,312 changes: 2,312 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/SPIN1_CHG.cube

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ATOMIC_SPECIES
Si 14 Si_ONCV_PBE-1.0.upf upf201

NUMERICAL_ORBITAL
Si_gga_8au_60Ry_2s2p1d.orb

LATTICE_CONSTANT
10.2 // add lattice constant

LATTICE_VECTORS
0.5 0.5 0.0
0.5 0.0 0.5
0.0 0.5 0.5

ATOMIC_POSITIONS
Direct

Si // Element type
0.0 // magnetism
2
0.00 0.00 0.00 1 1 1
0.25 0.25 0.25 1 1 1
459 changes: 459 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/data-SR-sparse_SPIN0.csr.ref

Large diffs are not rendered by default.

375 changes: 375 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/data-TR-sparse_SPIN0.csr.ref

Large diffs are not rendered by default.

1,548 changes: 1,548 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/data-rR-sparse.csr.ref

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/integrate/207_NO_KP_OH_nscf/jd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output HR, TR, rR files with nscf calculation
4 changes: 4 additions & 0 deletions tests/integrate/207_NO_KP_OH_nscf/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CompareSR_pass 0
ComparerR_pass 0
ComparerTR_pass 0
totaltimeref 1.88
1 change: 1 addition & 0 deletions tests/integrate/CASES_CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
206_NO_PU_chargemixing
207_NO_KP_OB
207_NO_KP_OD
207_NO_KP_OH_nscf
207_NO_KP_OH
207_NO_KP_OH2
207_NO_KP_OHS_SPIN4
Expand Down

0 comments on commit cc96be0

Please sign in to comment.