(git:c641773)
Loading...
Searching...
No Matches
qs_scf_lanczos_c.F File Reference

Go to the source code of this file.

Data Types

type  qs_scf_lanczos_c::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...

Modules

module  qs_scf_lanczos_c
 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.

Functions/Subroutines

subroutine, public qs_scf_lanczos_c::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 qs_scf_lanczos_c::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 qs_scf_lanczos_c::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 qs_scf_lanczos_c::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 qs_scf_lanczos_c::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 qs_scf_lanczos_c::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.