File tree Expand file tree Collapse file tree
source/source_lcao/module_deltap Expand file tree Collapse file tree Original file line number Diff line number Diff 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);
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ K_POINTS
2+ 0
3+ Gamma
4+ 1 1 2 0 0 0
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments