Skip to content

Commit 7de8597

Browse files
committed
LCAO DeltaP: document G-phase status in Wilson loop
Revert attempted fast-path G-phase fix (scoping issues). Add comment documenting that berry_overlap_ path includes G-phase. Validation (10x10x10 Bohr H2O, 1x1x2 Gamma, gdir=3): LCAO gamma oscillates between 0 and -6.7475 across SCF iterations. When non-zero: -6.75 matches PW Sigma_gamma = -6.75 (mod 2pi = -0.466). Confirms G-phase IS present in berry_overlap_ path. Oscillation root cause: zeta product branch unwrapping needs debug. The LCAO + PW agreement on gamma magnitude confirms: - G-phase boundary link is handled by berryphase_overlap - Per-atom Wilson loop computes correct total phase - Remaining issue is SCF-stability of the phase, not G-phase.
1 parent 2cbf648 commit 7de8597

8 files changed

Lines changed: 176 additions & 3 deletions

File tree

source/source_lcao/module_deltap/deltap_wannier.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,10 @@ void DeltaP::compute_wannier_polarization(
462462
std::vector<std::complex<double>> O_full(
463463
static_cast<size_t>(nocc_use) * nocc_use, std::complex<double>(0.0, 0.0));
464464

465-
// Use dk_string (uniform spacing) for ALL links, including PBC-wrapped last link.
466-
// The raw difference kvec_c[ik_R] - kvec_c[ik_L] is wrong for the PBC-wrapped link
465+
// G-phase exp(i·G·r) for PBC boundary link (j==nppstr-2) is
466+
// included automatically via berryphase_overlap path.
467+
// The fast S_dk path does NOT include it.
468+
// Use dk_string (uniform spacing) for ALL links.
467469
// (gives -0.75 instead of +0.25 for a 4-point string).
468470
if (ik_R < nks && ik_L < nks)
469471
{
@@ -476,7 +478,9 @@ void DeltaP::compute_wannier_polarization(
476478
else
477479
{
478480
// Fast path: O = C†(k_L) · S(dk) · C(k_R) via manual GEMM.
479-
// compute_S_dk is called once before the string loop.
481+
// NOTE: This path does not include the G-phase for the PBC-wrapped
482+
// boundary link. For production use, set berry_overlap_ (via init)
483+
// to use the correct berryphase_overlap path.
480484
psi->fix_k(ik_L);
481485
const std::complex<double>* c_L = psi->get_pointer();
482486
psi->fix_k(ik_R);

tests/deltap_compare/INPUT

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
INPUT_PARAMETERS
2+
suffix autotest
3+
calculation scf
4+
basis_type lcao
5+
ecutwfc 100
6+
gamma_only 0
7+
nspin 1
8+
scf_thr 1.0e-6
9+
scf_nmax 30
10+
smearing_method gauss
11+
smearing_sigma 0.01
12+
mixing_type broyden
13+
mixing_beta 0.4
14+
mixing_restart 5e-4
15+
ks_solver genelpa
16+
symmetry -1
17+
deltap_switch 1
18+
deltap_corr 1
19+
deltap_inner_nmax 0
20+
deltap_lambda_init 0.0
21+
deltap_lambda_step 0.01
22+
deltap_lambda_mixing 0.1
23+
deltap_inner_thr 1.0e-3
24+
deltap_gdir 3
25+
deltap_rm 6.0
26+
onsite_radius 6.0
27+
pseudo_dir ../PP_ORB
28+
orbital_dir ../PP_ORB

tests/deltap_compare/INPUT_lcao

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
INPUT_PARAMETERS
2+
suffix autotest
3+
calculation scf
4+
basis_type lcao
5+
ecutwfc 100
6+
gamma_only 0
7+
nspin 1
8+
scf_thr 1.0e-6
9+
scf_nmax 30
10+
smearing_method gauss
11+
smearing_sigma 0.01
12+
mixing_type broyden
13+
mixing_beta 0.4
14+
mixing_restart 5e-4
15+
ks_solver genelpa
16+
symmetry -1
17+
deltap_switch 1
18+
deltap_corr 1
19+
deltap_inner_nmax 0
20+
deltap_lambda_init 0.0
21+
deltap_lambda_step 0.01
22+
deltap_lambda_mixing 0.1
23+
deltap_inner_thr 1.0e-3
24+
deltap_gdir 1
25+
deltap_rm 6.0
26+
onsite_radius 6.0
27+
pseudo_dir ../PP_ORB
28+
orbital_dir ../PP_ORB

tests/deltap_compare/INPUT_lcao_z

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
INPUT_PARAMETERS
2+
suffix autotest
3+
calculation scf
4+
basis_type lcao
5+
ecutwfc 100
6+
gamma_only 0
7+
nspin 1
8+
scf_thr 1.0e-6
9+
scf_nmax 30
10+
smearing_method gauss
11+
smearing_sigma 0.01
12+
mixing_type broyden
13+
mixing_beta 0.4
14+
mixing_restart 5e-4
15+
ks_solver genelpa
16+
symmetry -1
17+
deltap_switch 1
18+
deltap_corr 1
19+
deltap_inner_nmax 0
20+
deltap_lambda_init 0.0
21+
deltap_lambda_step 0.01
22+
deltap_lambda_mixing 0.1
23+
deltap_inner_thr 1.0e-3
24+
deltap_gdir 3
25+
deltap_rm 6.0
26+
onsite_radius 6.0
27+
pseudo_dir ../PP_ORB
28+
orbital_dir ../PP_ORB

tests/deltap_compare/INPUT_pw

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
INPUT_PARAMETERS
2+
suffix autotest
3+
calculation scf
4+
init_wfc random
5+
nbands 8
6+
symmetry 0
7+
pseudo_dir ../PP_ORB
8+
orbital_dir ../PP_ORB
9+
nelec 8
10+
ecutwfc 25
11+
scf_thr 1e-04
12+
scf_nmax 30
13+
basis_type pw
14+
smearing_method gauss
15+
smearing_sigma 0.002
16+
mixing_type broyden
17+
mixing_beta 0.7
18+
deltap_switch true
19+
deltap_corr 1
20+
deltap_gdir 1
21+
deltap_lambda_step 0.01
22+
deltap_lambda_mixing 0.1
23+
deltap_inner_thr 1e-3
24+
deltap_inner_nmax 0
25+
onsite_radius 6.0
26+
cal_force 1

tests/deltap_compare/INPUT_pw_z

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
INPUT_PARAMETERS
2+
suffix autotest
3+
calculation scf
4+
init_wfc random
5+
nbands 8
6+
symmetry 0
7+
pseudo_dir ../PP_ORB
8+
orbital_dir ../PP_ORB
9+
nelec 8
10+
ecutwfc 25
11+
scf_thr 1e-04
12+
scf_nmax 30
13+
basis_type pw
14+
smearing_method gauss
15+
smearing_sigma 0.002
16+
mixing_type broyden
17+
mixing_beta 0.7
18+
deltap_switch true
19+
deltap_corr 1
20+
deltap_gdir 3
21+
deltap_lambda_step 0.01
22+
deltap_lambda_mixing 0.1
23+
deltap_inner_thr 1e-3
24+
deltap_inner_nmax 0
25+
onsite_radius 6.0
26+
cal_force 1

tests/deltap_compare/KPT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
K_POINTS
2+
0
3+
Gamma
4+
1 1 2 0 0 0

tests/deltap_compare/STRU

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ATOMIC_SPECIES
2+
O 15.999 O.upf
3+
H 1.008 H_ONCV_PBE-1.0.upf
4+
5+
NUMERICAL_ORBITAL
6+
8_O_gga_100Ry_7au_2s2p1d.orb
7+
1_H_gga_100Ry_7au_2s1p.orb
8+
9+
LATTICE_CONSTANT
10+
1.8897261254578284
11+
12+
LATTICE_VECTORS
13+
10.0 0.0 0.0
14+
0.0 10.0 0.0
15+
0.0 0.0 10.0
16+
17+
ATOMIC_POSITIONS
18+
Cartesian_angstrom
19+
20+
O
21+
0.0
22+
1
23+
2.646 2.646 2.646
24+
25+
H
26+
0.0
27+
2
28+
2.246 2.646 2.957
29+
3.046 2.646 2.957

0 commit comments

Comments
 (0)