![]() |
(git:c641773)
|
Complex block-Lanczos refinement kernel for k-point SCF diagonalization. Processes unconverged columns in blocks of NBLOCK with two-pass DGKS reorthogonalization against the working basis and deflation prefix, BLAS-3 CholeskyQR2 batch orthonormalization (with CGS2 fallback on rank-deficient batches), and an explicit Hermitian Rayleigh-Ritz projection T = V^dag(A V). Scratch matrices and local LAPACK buffers live in a caller-owned workspace reused across sweeps. More...
Data Types | |
| type | lanczos_workspace_type |
| Caller-owned scratch of the refinement kernel: every matrix and array that the sweeps of one channel reuse. The driver creates the workspace once per diagonalization call and hands it to every kernel call. The widths follow the worst case of the run. The basis budget holds the larger of the NKRYLOV block budget and four times the widest single block, and every per-call clamp stays below it. The small Rayleigh-Ritz pair keeps its per-block right-sized allocation, because the solver stack diagonalizes whole matrices and knows no leading-block argument. More... | |
Functions/Subroutines | |
| subroutine, public | lanczos_refinement_2v_c (ks, c0, eval, eps_col, nkrylov, nblock, ws, max_res_norm, min_res_norm, nmo_conv, nmo_nc, check_moconv_only) |
| Refine the non-converged columns of c0 on the standardized operator ks. The entry Rayleigh-Ritz pass updates the convergence statistics. Every non-converged column block then runs a single-pass Lanczos refinement. A full Cholesky sweep closes the call. | |
| subroutine, public | lanczos_channel_begin (ks, c0, eval, eps_col, ws, max_res_norm, min_res_norm, nmo_conv, nmo_nc, check_moconv_only) |
| Entry preparation of one (k-point, spin) channel before its inner Lanczos sweeps: orthonormalizes the input MOS (skipped for a read-only convergence probe), runs the full-width entry Rayleigh-Ritz pass, and computes the initial leading converged prefix and residual bounds. | |
| subroutine, public | lanczos_sweep_suffix (ks, c0, eval, eps_col, nkrylov, nblock, first_sweep, need_suffix_rr, ws, max_res_norm, min_res_norm, nmo_conv, nmo_nc, step_refined, next_need_suffix_rr) |
| Run one inner Lanczos sweep on the unconverged suffix of c0. When the previous sweep ran in multi-block mode or had a truncated block, a local suffix Rayleigh-Ritz pass first decouples the unconverged tail of width nmo_nc without touching the locked prefix 1..nmo_conv. | |
| subroutine, public | lanczos_channel_end (c0, ws) |
| Defensive full-width Cholesky orthonormalization at the end of a channel's refinement sweeps, executed at most once per channel. | |
| subroutine, public | lanczos_workspace_create (ws, mo_struct, ao_struct, nkrylov, nblock) |
| Create the kernel workspace at the worst-case widths of the run. The basis budget holds the larger of the NKRYLOV block budget and four times the widest single block, and every per-call clamp of the kernel stays below it. A single block covers every pending column only when NBLOCK spans them, so four times MIN(NBLOCK, nmo) bounds that regime. The candidate and Ritz widths hold the widest block a run can form. | |
| subroutine, public | lanczos_workspace_release (ws) |
| Release the kernel workspace. Safe on a workspace that was never created: the matrix components default to disassociated and the arrays to unallocated. | |
Complex block-Lanczos refinement kernel for k-point SCF diagonalization. Processes unconverged columns in blocks of NBLOCK with two-pass DGKS reorthogonalization against the working basis and deflation prefix, BLAS-3 CholeskyQR2 batch orthonormalization (with CGS2 fallback on rank-deficient batches), and an explicit Hermitian Rayleigh-Ritz projection T = V^dag(A V). Scratch matrices and local LAPACK buffers live in a caller-owned workspace reused across sweeps.
| subroutine, public qs_scf_lanczos_c::lanczos_refinement_2v_c | ( | type(cp_cfm_type), intent(in) | ks, |
| type(cp_cfm_type), intent(inout) | c0, | ||
| real(dp), dimension(:), pointer | eval, | ||
| real(dp), dimension(:), intent(in) | eps_col, | ||
| integer, intent(in) | nkrylov, | ||
| integer, intent(in) | nblock, | ||
| type(lanczos_workspace_type), intent(inout) | ws, | ||
| real(dp), intent(out) | max_res_norm, | ||
| real(dp), intent(out) | min_res_norm, | ||
| integer, intent(out) | nmo_conv, | ||
| integer, intent(out) | nmo_nc, | ||
| logical, intent(in), optional | check_moconv_only ) |
Refine the non-converged columns of c0 on the standardized operator ks. The entry Rayleigh-Ritz pass updates the convergence statistics. Every non-converged column block then runs a single-pass Lanczos refinement. A full Cholesky sweep closes the call.
| ks | standardized operator A = U^-dag H U^-1, nao x nao |
| c0 | current MOS in the standardized basis, refined in place. The matrix dimensions of the call follow c0 |
| eval | eigenvalues of c0, updated in place by the entry Rayleigh-Ritz |
| eps_col | per-column convergence thresholds on the residual norms: the driver assigns the relaxed empty threshold to the unoccupied columns. The occupation decides, not the column index. This mirrors the Davidson k-point driver |
| nkrylov | number of block expansion steps in the block regime. The kernel uses it as a floor on the budget only when NBLOCK covers every pending column |
| nblock | number of columns refined jointly, one or more |
| ws | caller-owned scratch of the call, created by the driver at the worst-case widths of the run |
| max_res_norm | largest residual column norm on exit: the entry Rayleigh-Ritz values, or the wanted-pair residuals of the refinement blocks when a refinement ran |
| min_res_norm | smallest residual column norm on exit (same basis) |
| nmo_conv | number of leading converged columns on exit |
| nmo_nc | columns outside the leading converged prefix: every still-unconverged column, plus converged columns beyond a gap. The count stays conservative for the not-converged reporting |
| check_moconv_only | only run the entry Rayleigh-Ritz and the convergence count, skip the refinement |
Definition at line 107 of file qs_scf_lanczos_c.F.
| subroutine, public qs_scf_lanczos_c::lanczos_channel_begin | ( | type(cp_cfm_type), intent(in) | ks, |
| type(cp_cfm_type), intent(inout) | c0, | ||
| real(dp), dimension(:), pointer | eval, | ||
| real(dp), dimension(:), intent(in) | eps_col, | ||
| type(lanczos_workspace_type), intent(inout) | ws, | ||
| real(dp), intent(out) | max_res_norm, | ||
| real(dp), intent(out) | min_res_norm, | ||
| integer, intent(out) | nmo_conv, | ||
| integer, intent(out) | nmo_nc, | ||
| logical, intent(in), optional | check_moconv_only ) |
Entry preparation of one (k-point, spin) channel before its inner Lanczos sweeps: orthonormalizes the input MOS (skipped for a read-only convergence probe), runs the full-width entry Rayleigh-Ritz pass, and computes the initial leading converged prefix and residual bounds.
| ks | standardized operator A = U^-dag H U^-1, nao x nao |
| c0 | current MOS in the standardized basis, rotated in place |
| eval | eigenvalues of c0, updated in place |
| eps_col | per-column convergence thresholds |
| ws | caller-owned channel workspace |
| max_res_norm | largest entry residual norm |
| min_res_norm | smallest entry residual norm |
| nmo_conv | number of leading converged columns on entry |
| nmo_nc | number of columns outside the leading converged prefix |
| check_moconv_only | skip the entry Cholesky orthonormalization for a read-only probe |
Definition at line 167 of file qs_scf_lanczos_c.F.
| subroutine, public qs_scf_lanczos_c::lanczos_sweep_suffix | ( | type(cp_cfm_type), intent(in) | ks, |
| type(cp_cfm_type), intent(inout) | c0, | ||
| real(dp), dimension(:), pointer | eval, | ||
| real(dp), dimension(:), intent(in) | eps_col, | ||
| integer, intent(in) | nkrylov, | ||
| integer, intent(in) | nblock, | ||
| logical, intent(in) | first_sweep, | ||
| logical, intent(in) | need_suffix_rr, | ||
| type(lanczos_workspace_type), intent(inout) | ws, | ||
| real(dp), intent(inout) | max_res_norm, | ||
| real(dp), intent(inout) | min_res_norm, | ||
| integer, intent(inout) | nmo_conv, | ||
| integer, intent(inout) | nmo_nc, | ||
| logical, intent(out) | step_refined, | ||
| logical, intent(out) | next_need_suffix_rr ) |
Run one inner Lanczos sweep on the unconverged suffix of c0. When the previous sweep ran in multi-block mode or had a truncated block, a local suffix Rayleigh-Ritz pass first decouples the unconverged tail of width nmo_nc without touching the locked prefix 1..nmo_conv.
| ks | standardized operator, nao x nao |
| c0 | MOS, refined in place on columns nmo_conv+1..nmo |
| eval | eigenvalues, updated in place on the unconverged suffix |
| eps_col | per-column convergence thresholds |
| nkrylov | number of block expansion steps in the block regime |
| nblock | number of columns refined jointly |
| first_sweep | true on the first sweep right after lanczos_channel_begin |
| need_suffix_rr | whether to run a local suffix Rayleigh-Ritz before refining |
| ws | caller-owned channel workspace |
| max_res_norm | largest residual norm of the active suffix on exit |
| min_res_norm | smallest residual norm of the active suffix on exit |
| nmo_conv | leading converged column count, advanced in place |
| nmo_nc | unconverged suffix width, updated in place |
| step_refined | whether this sweep modified c0 |
| next_need_suffix_rr | whether the next sweep requires a suffix RR |
Definition at line 243 of file qs_scf_lanczos_c.F.
| subroutine, public qs_scf_lanczos_c::lanczos_channel_end | ( | type(cp_cfm_type), intent(inout) | c0, |
| type(lanczos_workspace_type), intent(inout) | ws ) |
Defensive full-width Cholesky orthonormalization at the end of a channel's refinement sweeps, executed at most once per channel.
| c0 | refined MOS in the standardized basis |
| ws | caller-owned channel workspace |
Definition at line 309 of file qs_scf_lanczos_c.F.
| subroutine, public qs_scf_lanczos_c::lanczos_workspace_create | ( | type(lanczos_workspace_type), intent(out) | ws, |
| type(cp_fm_struct_type), pointer | mo_struct, | ||
| type(cp_fm_struct_type), pointer | ao_struct, | ||
| integer, intent(in) | nkrylov, | ||
| integer, intent(in) | nblock ) |
Create the kernel workspace at the worst-case widths of the run. The basis budget holds the larger of the NKRYLOV block budget and four times the widest single block, and every per-call clamp of the kernel stays below it. A single block covers every pending column only when NBLOCK spans them, so four times MIN(NBLOCK, nmo) bounds that regime. The candidate and Ritz widths hold the widest block a run can form.
| ws | workspace to create |
| mo_struct | structure of the channel MOS, nao x nmo |
| ao_struct | structure of the channel operators, nao x nao |
| nkrylov | number of block expansion steps of the block regime |
| nblock | number of columns refined jointly |
Definition at line 819 of file qs_scf_lanczos_c.F.
| subroutine, public qs_scf_lanczos_c::lanczos_workspace_release | ( | type(lanczos_workspace_type), intent(inout) | ws | ) |
Release the kernel workspace. Safe on a workspace that was never created: the matrix components default to disassociated and the arrays to unallocated.
| ws | workspace to release |
Definition at line 896 of file qs_scf_lanczos_c.F.