ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hsolver_lcao.h
Go to the documentation of this file.
1#ifndef HSOLVERLCAO_H
2#define HSOLVERLCAO_H
3
7
8#include "source_estate/module_charge/charge.h" // mohan add 20251024
9#include "source_estate/module_dm/density_matrix.h" // mohan add 20251103
10
11namespace hsolver
12{
13
14template <typename TK>
16{
17 public:
19 const std::string method_in,
20 const int kpar_lcao_in,
21 const int nlocal_in,
22 const int nbands_in,
23 const double nelec_in,
24 const bool use_gpu_in,
25 const int world_nproc_in,
26 const int world_rank_in,
27 const double overlap_cutoff_in)
28 : ParaV(ParaV_in), method(method_in), kpar_lcao(kpar_lcao_in), nlocal(nlocal_in), nbands(nbands_in),
29 nelec(nelec_in), use_gpu(use_gpu_in), world_nproc(world_nproc_in), world_rank(world_rank_in), overlap_cutoff(overlap_cutoff_in){};
30
32 void solve(HSMatrix<TK>& hs,
35 module_dm::DensityMatrix<TK, double>& dm, // mohan add 2025-11-03
36 Charge &chr, // charge density
37 const int nspin,
38 const double omega, // current cell volume (ucell.omega), NOT rhopw->omega
39 const bool skip_charge);
40
41 private:
45 double* eigenvalue,
46 int kpoint,
47 const Parallel_Blkcyclic* pool);
48
49 void parakSolve(HSMatrix<TK>& hs,
52 const int kpar,
53 const int nspin); // for kpar_lcao > 1
54
55 // The solving algorithm using cusolver is different from others, so a separate function is needed
59
60 const Parallel_Orbitals* ParaV = nullptr;
61
62 const std::string method;
63
64 const int kpar_lcao; // number of pools for LCAO diagonalization
65 const int nlocal; // global dimension of the NAO Hamiltonian
66 const int nbands; // number of bands to be solved for
67 const double nelec; // total number of electrons, only used by the pexsi branch
68 const bool use_gpu; // true if running on GPU, only used by the native-ELPA branch
69 const int world_nproc;
70 const int world_rank;
71 const double overlap_cutoff;
72};
73
74} // namespace hsolver
75
76#endif
Definition charge.h:24
Parallel block-cyclic matrix distribution.
Definition parallel_blkcyc.h:25
Definition parallel_orbitals.h:16
Definition elecstate.h:20
What a direct (dense) eigensolver needs from the generalized eigenproblem H x = e S x: the matrices H...
Definition hs_matrix.h:19
const Parallel_Orbitals * ParaV
Definition hsolver_lcao.h:60
void solve(HSMatrix< TK > &hs, psi::Psi< TK > &psi, elecstate::ElecState *pes, module_dm::DensityMatrix< TK, double > &dm, Charge &chr, const int nspin, const double omega, const bool skip_charge)
Definition hsolver_lcao.cpp:29
const int world_nproc
Definition hsolver_lcao.h:69
void parakSolve(HSMatrix< TK > &hs, psi::Psi< TK > &psi, elecstate::ElecState *pes, const int kpar, const int nspin)
Definition hsolver_lcao.cpp:164
const int nbands
Definition hsolver_lcao.h:66
const double overlap_cutoff
Definition hsolver_lcao.h:71
const int nlocal
Definition hsolver_lcao.h:65
const bool use_gpu
Definition hsolver_lcao.h:68
HSolverLCAO(const Parallel_Orbitals *ParaV_in, const std::string method_in, const int kpar_lcao_in, const int nlocal_in, const int nbands_in, const double nelec_in, const bool use_gpu_in, const int world_nproc_in, const int world_rank_in, const double overlap_cutoff_in)
Definition hsolver_lcao.h:18
void hamiltSolvePsiK(ModuleBase::MatrixBlock< TK > &hk, ModuleBase::MatrixBlock< TK > &sk, psi::Psi< TK > &psi, double *eigenvalue, int kpoint, const Parallel_Blkcyclic *pool)
Definition hsolver_lcao.cpp:128
const int kpar_lcao
Definition hsolver_lcao.h:64
const std::string method
Definition hsolver_lcao.h:62
const int world_rank
Definition hsolver_lcao.h:70
void parakSolve_cusolver(HSMatrix< TK > &hs, psi::Psi< TK > &psi, elecstate::ElecState *pes)
const double nelec
Definition hsolver_lcao.h:67
DensityMatrix Class <TK,TR> = <double,double> for Gamma-only calculation <TK,TR> = <std::complex<doub...
Definition density_matrix.h:172
Definition psi.h:37
Definition dense_eigensolver.cpp:23
Definition diag_lcao.h:14
A non-owning description of a matrix stored in memory.
Definition matrix_block.h:23