Skip to content

Commit 446baa4

Browse files
committed
feat(deltaspin): enable linear_scan strategy for PW basis set
Add sc_lambda_strategy=linear_scan support to PW DeltaSpin path. Previously this was only available for LCAO. The PW path now checks the strategy flag and routes to run_lambda_linear_scan() which sweeps lambda values and records Mi vs lambda to lambda_scan_results.dat for energy landscape analysis.
1 parent 0c42d43 commit 446baa4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

source/source_pw/module_pwdft/deltaspin_pw.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ bool run_deltaspin_lambda_loop(const int iter,
2020
spinconstrain::SpinConstrain<std::complex<double>>& sc
2121
= spinconstrain::SpinConstrain<std::complex<double>>::getScInstance();
2222

23+
/// Case 0: linear_scan strategy - sweep lambda values for energy landscape mapping
24+
/// This is a diagnostic/debugging mode that does NOT optimize lambda,
25+
/// only records Mi vs lambda to lambda_scan_results.dat.
26+
if (inp.sc_lambda_strategy == "linear_scan")
27+
{
28+
sc.run_lambda_linear_scan(iter);
29+
return true;
30+
}
31+
2332
/// Case 1: Magnetic moments not yet converged and SCF is close to convergence.
2433
/// This is the first time we enter the lambda loop after SCF is nearly converged.
2534
if (!sc.mag_converged() && drho > 0 && drho < inp.sc_scf_thr)

0 commit comments

Comments
 (0)