Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
4acf8ca
2025PKUCourseHW5: Case: 1 - Change rank_seed_offset to static const
cheerly-pku Mar 28, 2026
c54aac5
Merge pull request #1 from Silver-Moon-Over-Snow/Silver-Moon-Over-Sno…
cheerly-pku Mar 28, 2026
902a6a3
Merge branch 'deepmodeling:develop' into develop
cheerly-pku Apr 7, 2026
42417ad
Merge branch 'deepmodeling:develop' into develop
cheerly-pku Apr 8, 2026
7649894
Merge branch 'deepmodeling:develop' into develop
cheerly-pku May 30, 2026
f93ba7c
feat: add DiagoPPCG solver (Projection Preconditioned Conjugate Gradi…
cheerly-pku May 30, 2026
0496c6c
fix: stabilize DiagoPPCG - potrf retry, sygvd double-call, and orthon…
cheerly-pku May 30, 2026
30276e4
fix: stabilize PPCG for nband>1 - Krylov fallback, M save/restore, CG…
cheerly-pku May 30, 2026
f06ad8a
fix: use full complex inner product for gradient/vector projections
cheerly-pku May 30, 2026
a4729c8
fix: remove extra chol_qr_active after update_one_block in BLOCK_SUBS…
cheerly-pku May 31, 2026
49f70c2
revert: remove unintended 'static' from rank_seed_offset in sto_wf.cpp
cheerly-pku May 31, 2026
3713712
fix: use real-only initial wavefunctions in PPCG unit test
cheerly-pku May 31, 2026
c2a32db
fix: disable 3-block [psi,w,p] subspace to prevent M-matrix ill-condi…
cheerly-pku Jun 3, 2026
8340fd7
fix: use rr_step=1 for CG to prevent Cholesky band mixing
cheerly-pku Jun 3, 2026
126fdc8
fix: remove orth_cholesky before rayleigh_ritz in CG RR path
cheerly-pku Jun 5, 2026
5c287c5
fix: add initial Rayleigh-Ritz to CG strategy
cheerly-pku Jun 5, 2026
22ce9d2
temp: remove CG test, keep only BLOCK_SUBSPACE
cheerly-pku Jun 5, 2026
c7bba69
chore: remove .claude/settings.json, add to .gitignore
cheerly-pku Jun 5, 2026
f7a1ea0
fix: use exact quadratic root in line_minimize for CG strategy
cheerly-pku Jun 5, 2026
187c1f0
fix: use subspace diagonalization for CG non-RR eigenvalues; re-enabl…
cheerly-pku Jun 6, 2026
c1840ef
fix: revert BLOCK_SUBSPACE to use_p=false to avoid M singularity
cheerly-pku Jun 6, 2026
765064a
Merge branch 'develop' into ppcg
cheerly-pku Jun 6, 2026
30577b9
fix: normalize w/p to unit S-norm before building small subspace
cheerly-pku Jun 6, 2026
2204715
fix: fall back to 2-block subspace when p is bad instead of Krylov Hw
cheerly-pku Jun 6, 2026
5a428fc
test: expand PPCG unit tests with 6 test cases across diverse matrices
cheerly-pku Jun 11, 2026
2bfe9c3
Merge branch 'develop' into ppcg
cheerly-pku Jun 11, 2026
2047224
test: add 23 PPCG unit tests + 2 performance benchmarks
cheerly-pku Jun 11, 2026
6ab66f1
Merge branch 'develop' into ppcg
cheerly-pku Jun 16, 2026
c8e34da
Stabilize DiagoPPCG LAPACK fallback paths
cheerly-pku Jun 16, 2026
23ed821
Trigger CI rerun
cheerly-pku Jun 16, 2026
7fa4262
Remove local Claude ignore rule
cheerly-pku Jun 17, 2026
2824e76
Fix PPCG Hermitian subspace LAPACK usage
cheerly-pku Jun 17, 2026
4643b43
Make PPCG usable from PW solver
cheerly-pku Jun 22, 2026
8dac3d7
Link PPCG into hsolver PW tests
cheerly-pku Jun 22, 2026
698df04
Use complex Rayleigh-Ritz in PPCG line minimization
cheerly-pku Jun 22, 2026
7518187
Preserve band identity in PPCG line minimization
cheerly-pku Jun 23, 2026
fb4f10d
Restore stable PPCG line minimization
cheerly-pku Jun 25, 2026
a9791f5
Allow complex PPCG line-search steps
cheerly-pku Jun 25, 2026
be4034d
Add optional PPCG residual trace
cheerly-pku Jun 25, 2026
5ca458d
Document PPCG PW integration
cheerly-pku Jun 26, 2026
3e77c35
Unify PPCG LAPACK calls through ct::kernels layer
cheerly-pku Jun 26, 2026
3aff00c
Link PPCG test with container kernels
cheerly-pku Jun 26, 2026
79607ca
Avoid PPCG dependency on hegvd wrapper change
cheerly-pku Jun 26, 2026
d6407cd
Make PPCG tests C++11 compatible
cheerly-pku Jun 26, 2026
8377710
Revert PPCG ATen LAPACK refactor
cheerly-pku Jun 26, 2026
38d287c
Preserve hsolver test CMake EOF style
cheerly-pku Jul 1, 2026
ef80502
Refactor PPCG LAPACK calls through ATen kernels
cheerly-pku Jul 2, 2026
f32fd11
Refactor PPCG block subspace solver
cheerly-pku Jul 2, 2026
da1f555
Link EXX info in hsolver PW test
cheerly-pku Jul 2, 2026
e305e77
Quiet PPCG quick benchmark output
cheerly-pku Jul 2, 2026
d7627b2
Harden PPCG generalized eigensolver fallback
cheerly-pku Jul 2, 2026
2c8bf32
Use Cholesky reduction for PPCG generalized solves
cheerly-pku Jul 2, 2026
7f566b5
Use BLAS and pool reductions in PPCG projections
cheerly-pku Jul 2, 2026
b75d9d8
Complete PPCG pool reductions
cheerly-pku Jul 2, 2026
377fe68
Merge branch 'develop' into ppcg
cheerly-pku Jul 3, 2026
7e2c8b5
Parallelize local PPCG vector operations
cheerly-pku Jul 3, 2026
a238aed
Reduce PPCG projection reductions
cheerly-pku Jul 3, 2026
53fa285
Batch PPCG convergence reductions
cheerly-pku Jul 3, 2026
cb6eb6f
Batch PPCG subspace Gram builds
cheerly-pku Jul 3, 2026
227aaef
Reuse PPCG block bases
cheerly-pku Jul 3, 2026
f55a88e
Split PPCG helper headers
cheerly-pku Jul 3, 2026
4314ebb
Fix PPCG governance check findings
cheerly-pku Jul 3, 2026
1995a0a
Reduce PPCG temporary allocations
cheerly-pku Jul 3, 2026
d33ddb0
Avoid redundant PPCG Gram initialization
cheerly-pku Jul 4, 2026
ee607b1
Reuse PPCG Rayleigh-Ritz workspaces
cheerly-pku Jul 4, 2026
c7d1617
Reduce PPCG subspace initialization
cheerly-pku Jul 4, 2026
095ee27
Skip unused PPCG direction updates
cheerly-pku Jul 4, 2026
f215024
Apply PPCG S operator on active columns
cheerly-pku Jul 4, 2026
f8f3900
Avoid unused PPCG direction workspaces
cheerly-pku Jul 4, 2026
10c3123
Remove unused PPCG helpers
cheerly-pku Jul 4, 2026
d31d9e2
Drop unused PPCG gradient history
cheerly-pku Jul 4, 2026
ffa2f72
Keep PPCG block subspace two-block only
cheerly-pku Jul 4, 2026
cfa57b4
Use GEMM for PPCG projections
cheerly-pku Jul 4, 2026
d959dbf
Avoid PPCG projection copies for contiguous columns
cheerly-pku Jul 4, 2026
dc13fa6
Generalize contiguous PPCG projection basis
cheerly-pku Jul 4, 2026
da90829
Use GEMM for PPCG CG gradient projection
cheerly-pku Jul 4, 2026
48dc80c
Fast path contiguous PPCG column copies
cheerly-pku Jul 4, 2026
4da5661
Test PPCG with padded leading dimension
cheerly-pku Jul 4, 2026
4d21088
Cover PPCG overlap with padded leading dimension
cheerly-pku Jul 4, 2026
550e807
Validate PPCG H operator input
cheerly-pku Jul 4, 2026
caacb1f
Reject non-finite PPCG inputs
cheerly-pku Jul 4, 2026
f1b8063
Document PPCG use of pw_diag_ndim
cheerly-pku Jul 4, 2026
71a7958
Reserve PPCG active worklists
cheerly-pku Jul 4, 2026
fdca80a
Reserve PPCG projection buffers
cheerly-pku Jul 6, 2026
f7a04ef
Cover PPCG residual trace output
cheerly-pku Jul 6, 2026
a910418
Bridge PPCG through device H and S operators
cheerly-pku Jul 7, 2026
3251840
Reuse PPCG block subspace buffers
cheerly-pku Jul 7, 2026
7cd0db3
Document PPCG device bridge status
cheerly-pku Jul 7, 2026
00f39b9
Merge remote-tracking branch 'upstream/develop' into ppcg
cheerly-pku Jul 8, 2026
c3bbfe4
Merge remote-tracking branch 'upstream/develop' into ppcg
cheerly-pku Jul 8, 2026
b2ae9f7
Reduce PPCG public header includes
cheerly-pku Jul 8, 2026
553d25e
Tighten PPCG OpenMP updates
cheerly-pku Jul 8, 2026
d47d633
Reduce PPCG subspace scaling overhead
cheerly-pku Jul 8, 2026
8c79a70
Tidy PPCG test includes
cheerly-pku Jul 8, 2026
e3fed1f
Clarify PPCG subspace scaling scratch
cheerly-pku Jul 8, 2026
fe690a0
Merge remote-tracking branch 'upstream/develop' into ppcg
cheerly-pku Jul 15, 2026
4260d50
Sync generated INPUT documentation
cheerly-pku Jul 15, 2026
8d62627
Reuse generalized eigensolver in PPCG
cheerly-pku Jul 15, 2026
38034b9
Revise the ppcg code based on Professor Chen's review comments
cheerly-pku Aug 12, 2026
55d99fc
Merge upstream/develop into pr-7580: resolve ks_solver doc conflicts …
cheerly-pku Aug 12, 2026
483f465
Fix missing explicit instantiation of Parallel_Reduce::reduce_pool fo…
cheerly-pku Aug 12, 2026
f0a49e3
Retrigger CI
cheerly-pku Aug 12, 2026
c97bebe
Add 01_PW integration test for PPCG ks_solver
cheerly-pku Aug 22, 2026
763846f
Remove unused PPCG helper headers after consolidation into diago_ppcg…
cheerly-pku Aug 22, 2026
1fec4ec
Add head-to-head comparison benchmark for PW diagonalization solvers
cheerly-pku Aug 22, 2026
79ab472
Merge remote-tracking branch 'deepmodeling/develop' into pr-7580
cheerly-pku Aug 22, 2026
28d17a8
Fix para_lin_tf reference in solver comparison test after develop rename
cheerly-pku Aug 22, 2026
f06a6c5
Remove GlobalV::NPROC_IN_POOL assignment from solver comparison bench…
cheerly-pku Aug 22, 2026
a75161e
Regenerate parameter docs to sync pw_diag_ndim availability with C++ …
cheerly-pku Aug 22, 2026
b8aa691
Address review feedback in PPCG solver
cheerly-pku Aug 22, 2026
0879153
Use eigenvalue-change criterion for PPCG band locking
cheerly-pku Aug 23, 2026
80747a8
Regenerate 817_PW_PPCG reference after convergence-criterion change
cheerly-pku Aug 23, 2026
be5fb2e
Reduce Rayleigh-Ritz rotation frequency in PPCG block subspace
cheerly-pku Aug 23, 2026
c2afe2e
Use BLAS zgemm for the H operator in the solver comparison benchmark
cheerly-pku Aug 23, 2026
ee2f862
Revert Rayleigh-Ritz rotation frequency reduction
cheerly-pku Aug 23, 2026
7f14761
Replace static_cast with functional-style casts in PPCG code
cheerly-pku Aug 23, 2026
a488645
Add float, MPI, and GPU test coverage for PPCG
cheerly-pku Aug 23, 2026
eac9cd0
Fix float test robustness and remove GlobalV reference from MPI test
cheerly-pku Aug 23, 2026
02035d0
Fix scf_ppcg GPU case: remove k-point-incompatible use_k_continuity
cheerly-pku Aug 23, 2026
ce08e33
Wrap all for/if/while blocks in braces in PPCG test files
cheerly-pku Aug 23, 2026
4d3889a
Replace static_cast with functional-style casts in PPCG unit test
cheerly-pku Aug 23, 2026
1450f32
Reduce H/S re-application frequency in PPCG block subspace
cheerly-pku Aug 23, 2026
86b95bc
Add per-solver memory measurement to the comparison benchmark
cheerly-pku Aug 23, 2026
9aca420
Merge branch 'develop' into ppcg-v2
cheerly-pku Aug 23, 2026
f6f2be5
Expand PPCG description in the PW solver documentation
cheerly-pku Aug 23, 2026
b08abd6
Add command-line arguments to the solver comparison benchmark
cheerly-pku Aug 24, 2026
5c47e1a
Add pw_diag_rr_step to decouple the PPCG Rayleigh-Ritz interval from …
cheerly-pku Aug 24, 2026
f8387b8
Fix parameters.yaml availability quoting for pw_diag_rr_step
cheerly-pku Aug 24, 2026
de6dedf
Fix input-main.md formatting for pw_diag_rr_step
cheerly-pku Aug 25, 2026
b0e1748
Drop the solver-specific avg_iter column from the comparison benchmark
cheerly-pku Aug 26, 2026
4a2b8dd
Add a --strategy option to the solver comparison benchmark
cheerly-pku Aug 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
- [use\_k\_continuity](#use_k_continuity)
- [pw\_diag\_nmax](#pw_diag_nmax)
- [pw\_diag\_ndim](#pw_diag_ndim)
- [pw\_diag\_rr\_step](#pw_diag_rr_step)
- [diago\_cg\_prec](#diago_cg_prec)
- [Numerical atomic orbitals related variables](#numerical-atomic-orbitals-related-variables)
- [lmaxmax](#lmaxmax)
Expand Down Expand Up @@ -1058,7 +1059,7 @@
### pw_diag_thr

- **Type**: Real
- **Description**: Only used when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3.
- **Description**: Only used when you use ks_solver = cg/dav/dav_subspace/bpcg/ppcg. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3.
- **Default**: 0.01

### diago_smooth_ethr
Expand All @@ -1077,16 +1078,24 @@
### pw_diag_nmax

- **Type**: Integer
- **Availability**: *[`basis_type`](#basis_type)==pw and [`ks_solver`](#ks_solver) in [cg, dav, dav_subspace, bpcg]*
- **Description**: Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg method.
- **Availability**: *[`basis_type`](#basis_type)==pw and [`ks_solver`](#ks_solver) in [cg, dav, dav_subspace, bpcg, ppcg]*
- **Description**: Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg/ppcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg/ppcg method.
- **Default**: 50

### pw_diag_ndim

- **Type**: Integer
- **Description**: Only useful when you use ks_solver = dav or ks_solver = dav_subspace. It indicates dimension of workspace(number of wavefunction packets, at least 2 needed) for the Davidson method. A larger value may yield a smaller number of iterations in the algorithm but uses more memory and more CPU time in subspace diagonalization.
- **Availability**: *[`basis_type`](#basis_type)==pw and [`ks_solver`](#ks_solver) in [dav, dav_subspace, ppcg]*
- **Description**: Only useful when you use ks_solver = dav, dav_subspace, or ppcg. It indicates dimension of workspace(number of wavefunction packets, at least 2 needed) for the Davidson method, and the block size for the PPCG method. A larger value may yield a smaller number of iterations in the algorithm but uses more memory and more CPU time in subspace diagonalization.
- **Default**: 4

### pw_diag_rr_step

- **Type**: Integer
- **Availability**: *[`basis_type`](#basis_type)==pw and [`ks_solver`](#ks_solver)==ppcg*
- **Description**: Only useful when you use ks_solver = ppcg. It controls how often (in subspace iterations) H and S are re-applied to reset the accumulated rounding drift after the Rayleigh-Ritz rotation. A larger value reduces the number of H/S applications and thus the wall time without changing the iteration count in well-conditioned cases; a smaller value is more robust against rounding drift in ill-conditioned problems.
- **Default**: 16

### diago_cg_prec

- **Type**: Integer
Expand Down Expand Up @@ -1192,6 +1201,7 @@
- cg: The conjugate-gradient (CG) method.
- dav: The Davidson algorithm.
- dav_subspace: The Davidson algorithm without orthogonalization operation, this method is the most recommended for efficiency. `pw_diag_ndim` can be set to 2 for this method.
- ppcg: The projection preconditioned conjugate-gradient method. It is optimized and validated for CPU plane-wave calculations; non-CPU devices use a transitional host/device bridge.
- bpcg: The BPCG method, which is a block-parallel Conjugate Gradient (CG) method, typically exhibits higher acceleration in a GPU environment. The BPCG method is currently under testing and is not recommended for use.

For numerical atomic orbitals basis,
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/scf/hsolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Method of explicit solving KS-equation can be chosen by variable "ks_solver" in INPUT file.

When "basis_type = pw", `ks_solver` can be `cg`, `bpcg` or `dav`. The default setting `cg` is recommended, which is band-by-band conjugate gradient diagonalization method. There is a large probability that the use of setting of `dav` , which is block Davidson diagonalization method, can be tried to improve performance.
When "basis_type = pw", `ks_solver` can be `cg`, `bpcg`, `dav`, `dav_subspace`, or `ppcg`. The default setting `cg` is recommended, which is a band-by-band conjugate-gradient diagonalization method. The `dav` and `dav_subspace` settings use Davidson-style subspace diagonalization and can be tried to improve performance. The `ppcg` setting uses the projection preconditioned conjugate-gradient method (a restarted block method that keeps a bounded `2*nband` subspace). It targets the many-eigenpair regime where the bounded memory and block operations pay off; it is optimized and validated for CPU plane-wave calculations, and non-CPU devices use a transitional host/device bridge. The PPCG block size / Rayleigh-Ritz interval is controlled by `pw_diag_ndim`.

When "basis_type = lcao", `ks_solver` can be `genelpa` or `scalapack_gvx`. The default setting `genelpa` is recommended, which is based on ELPA (EIGENVALUE SOLVERS FOR PETAFLOP APPLICATIONS) (https://elpa.mpcdf.mpg.de/) and the kernel is auto choosed by GENELPA(https://github.com/pplab/GenELPA), usually faster than the setting of "scalapack_gvx", which is based on ScaLAPACK(Scalable Linear Algebra PACKage)

Expand Down
19 changes: 14 additions & 5 deletions docs/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ parameters:
* cg: The conjugate-gradient (CG) method.
* dav: The Davidson algorithm.
* dav_subspace: The Davidson algorithm without orthogonalization operation, this method is the most recommended for efficiency. `pw_diag_ndim` can be set to 2 for this method.
* ppcg: The projection preconditioned conjugate-gradient method. It is optimized and validated for CPU plane-wave calculations; non-CPU devices use a transitional host/device bridge.
* bpcg: The BPCG method, which is a block-parallel Conjugate Gradient (CG) method, typically exhibits higher acceleration in a GPU environment. The BPCG method is currently under testing and is not recommended for use.

For numerical atomic orbitals basis,
Expand Down Expand Up @@ -976,7 +977,7 @@ parameters:
category: Plane wave related variables
type: Real
description: |
Only used when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3.
Only used when you use ks_solver = cg/dav/dav_subspace/bpcg/ppcg. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3.
default_value: "0.01"
unit: ""
availability: ""
Expand All @@ -1000,18 +1001,26 @@ parameters:
category: Plane wave related variables
type: Integer
description: |
Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg method.
Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg/ppcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg/ppcg method.
default_value: "50"
unit: ""
availability: "basis_type==pw and ks_solver in [cg, dav, dav_subspace, bpcg]"
availability: "basis_type==pw and ks_solver in [cg, dav, dav_subspace, bpcg, ppcg]"
- name: pw_diag_ndim
category: Plane wave related variables
type: Integer
description: |
Only useful when you use ks_solver = dav or ks_solver = dav_subspace. It indicates dimension of workspace(number of wavefunction packets, at least 2 needed) for the Davidson method. A larger value may yield a smaller number of iterations in the algorithm but uses more memory and more CPU time in subspace diagonalization.
Only useful when you use ks_solver = dav, dav_subspace, or ppcg. It indicates dimension of workspace(number of wavefunction packets, at least 2 needed) for the Davidson method, and the block size for the PPCG method. A larger value may yield a smaller number of iterations in the algorithm but uses more memory and more CPU time in subspace diagonalization.
default_value: "4"
unit: ""
availability: ""
availability: "basis_type==pw and ks_solver in [dav, dav_subspace, ppcg]"
- name: pw_diag_rr_step
category: Plane wave related variables
type: Integer
description: |
Only useful when you use ks_solver = ppcg. It controls how often (in subspace iterations) H and S are re-applied to reset the accumulated rounding drift after the Rayleigh-Ritz rotation. A larger value reduces the number of H/S applications and thus the wall time without changing the iteration count in well-conditioned cases; a smaller value is more robust against rounding drift in ill-conditioned problems.
default_value: "16"
unit: ""
availability: basis_type==pw and ks_solver==ppcg
- name: diago_cg_prec
category: Plane wave related variables
type: Integer
Expand Down
1 change: 1 addition & 0 deletions source/source_base/parallel_reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ template void Parallel_Reduce::reduce_pool<double>(double&);
template void Parallel_Reduce::reduce_pool<std::complex<double>>(std::complex<double>&);

template void Parallel_Reduce::reduce_pool<int>(int*, const int);
template void Parallel_Reduce::reduce_pool<float>(float*, const int);
template void Parallel_Reduce::reduce_pool<double>(double*, const int);
template void Parallel_Reduce::reduce_pool<std::complex<float>>(std::complex<float>*, const int);
template void Parallel_Reduce::reduce_pool<std::complex<double>>(std::complex<double>*, const int);
Expand Down
1 change: 1 addition & 0 deletions source/source_hsolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ list(APPEND objects
diago_david.cpp
diago_dav_subspace.cpp
diago_bpcg.cpp
diago_ppcg.cpp
para_lin_tf.cpp
hsolver_pw.cpp
hsolver_lcaopw.cpp
Expand Down
10 changes: 9 additions & 1 deletion source/source_hsolver/diago_iter_assist.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class DiagoIterAssist
public:
static Real PW_DIAG_THR;
static int PW_DIAG_NMAX;
static int PW_DIAG_NDIM;
static int PW_DIAG_RR_STEP;

static Real LCAO_DIAG_THR;
static int LCAO_DIAG_NMAX;
Expand Down Expand Up @@ -157,6 +159,12 @@ typename DiagoIterAssist<T, Device>::Real DiagoIterAssist<T, Device>::avg_iter =
template <typename T, typename Device>
int DiagoIterAssist<T, Device>::PW_DIAG_NMAX = 30;

template <typename T, typename Device>
int DiagoIterAssist<T, Device>::PW_DIAG_NDIM = 4;

template <typename T, typename Device>
int DiagoIterAssist<T, Device>::PW_DIAG_RR_STEP = 16;

template <typename T, typename Device>
typename DiagoIterAssist<T, Device>::Real DiagoIterAssist<T, Device>::PW_DIAG_THR = 1.0e-2;

Expand All @@ -179,4 +187,4 @@ template <typename T, typename Device>
T DiagoIterAssist<T, Device>::zero = static_cast<T>(0.0);
} // namespace hsolver

#endif
#endif
4 changes: 4 additions & 0 deletions source/source_hsolver/diago_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ void setup_diago_params_pw(const int istep,
DiagoIterAssist<T, Device>::need_subspace = ((istep == 0 || istep == 1) && iter == 1) ? false : true;
DiagoIterAssist<T, Device>::SCF_ITER = iter;
DiagoIterAssist<T, Device>::PW_DIAG_THR = ethr;
DiagoIterAssist<T, Device>::PW_DIAG_NDIM = inp.pw_diag_ndim;
DiagoIterAssist<T, Device>::PW_DIAG_RR_STEP = inp.pw_diag_rr_step;

if (inp.calculation != "nscf")
{
Expand All @@ -41,6 +43,8 @@ void setup_diago_params_sdft(const int istep,

DiagoIterAssist<T, Device>::PW_DIAG_THR = ethr;
DiagoIterAssist<T, Device>::PW_DIAG_NMAX = inp.pw_diag_nmax;
DiagoIterAssist<T, Device>::PW_DIAG_NDIM = inp.pw_diag_ndim;
DiagoIterAssist<T, Device>::PW_DIAG_RR_STEP = inp.pw_diag_rr_step;
}

/// Template instantiation for CPU
Expand Down
Loading
Loading