ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
pexsi_solver.h
Go to the documentation of this file.
1#ifndef PEXSI_Solver_H
2#define PEXSI_Solver_H
3
4#include <vector>
5
6namespace pexsi
7{
9{
10 public:
11 void prepare(const int blacs_text,
12 const int nb,
13 const int nrow,
14 const int ncol,
15 const int nlocal,
16 const double nelec,
17 const double* h,
18 const double* s,
19 double*& DM,
20 double*& EDM);
21 int solve(double mu0, const int world_nproc);
22 const double get_totalFreeEnergy() const;
23 const double get_totalEnergyH() const;
24 const double get_totalEnergyS() const;
25 const double get_mu() const;
26
27 //==========================================================
28 // PEXSI related variables
29 //==========================================================
33 static int pexsi_npole;
37 static bool pexsi_inertia;
41 static int pexsi_nmax;
45 static bool pexsi_comm;
49 static bool pexsi_storage;
53 static int pexsi_ordering;
57 static int pexsi_row_ordering;
61 static int pexsi_nproc;
67 static bool pexsi_symm;
73 static bool pexsi_trans;
79 static int pexsi_method;
84 static int pexsi_nproc_pole;
88 static double pexsi_temp;
92 static double pexsi_gap;
96 static double pexsi_delta_e;
100 static double pexsi_mu_lower;
104 static double pexsi_mu_upper;
108 static double pexsi_mu;
112 static double pexsi_mu_thr;
116 static double pexsi_mu_expand;
120 static double pexsi_mu_guard;
124 static double pexsi_elec_thr;
128 static double pexsi_zero_thr;
129
130 private:
132 int nb;
133 int nrow;
134 int ncol;
135 int nlocal;
136 double nelec;
137 double* h = nullptr;
138 double* s = nullptr;
139 double* DM = nullptr;
140 double* EDM = nullptr;
144 double mu;
145};
146} // namespace pexsi
147#endif // PEXSI_Solver_H
Definition pexsi_solver.h:9
static double pexsi_zero_thr
If the absolute value of CCS matrix element is less than this value, it will be considered as zero.
Definition pexsi_solver.h:128
static int pexsi_npole
Number of terms in the pole expansion.
Definition pexsi_solver.h:33
static double pexsi_mu_upper
Initial guess of upper bound for mu.
Definition pexsi_solver.h:104
double totalEnergyS
Definition pexsi_solver.h:142
static double pexsi_mu_expand
If the chemical potential is not in the initial interval, the interval is expanded by muInertiaExpans...
Definition pexsi_solver.h:116
static double pexsi_mu_lower
Initial guess of lower bound for mu.
Definition pexsi_solver.h:100
static bool pexsi_inertia
Whether inertia counting is used at the very beginning.
Definition pexsi_solver.h:37
double totalEnergyH
Definition pexsi_solver.h:141
static double pexsi_temp
Temperature, in the same unit as H.
Definition pexsi_solver.h:88
const double get_totalEnergyS() const
double nelec
total number of electrons
Definition pexsi_solver.h:136
double * s
Definition pexsi_solver.h:138
double * DM
Definition pexsi_solver.h:139
double totalFreeEnergy
Definition pexsi_solver.h:143
static double pexsi_delta_e
An upper bound for the spectral radius of .
Definition pexsi_solver.h:96
static bool pexsi_trans
Transpose.
Definition pexsi_solver.h:73
const double get_totalEnergyH() const
static bool pexsi_storage
Whether to use symmetric storage space used by the Selected Inversion algorithm for symmetric matrice...
Definition pexsi_solver.h:49
static double pexsi_elec_thr
Stopping criterion of the PEXSI iteration in terms of the number of electrons compared to numElectron...
Definition pexsi_solver.h:124
int solve(double mu0, const int world_nproc)
int ncol
Definition pexsi_solver.h:134
void prepare(const int blacs_text, const int nb, const int nrow, const int ncol, const int nlocal, const double nelec, const double *h, const double *s, double *&DM, double *&EDM)
static double pexsi_mu
Initial guess for mu (for the solver) (AG).
Definition pexsi_solver.h:108
static int pexsi_ordering
Ordering strategy for factorization and selected inversion.
Definition pexsi_solver.h:53
int nrow
Definition pexsi_solver.h:133
double * h
Definition pexsi_solver.h:137
static double pexsi_gap
Spectral gap. Note This can be set to be 0 in most cases.
Definition pexsi_solver.h:92
int blacs_text
Definition pexsi_solver.h:131
static double pexsi_mu_guard
Safe guard criterion in terms of the chemical potential to reinvoke the inertia counting procedure.
Definition pexsi_solver.h:120
static double pexsi_mu_thr
Stopping criterion in terms of the chemical potential for the inertia counting procedure.
Definition pexsi_solver.h:112
static int pexsi_nproc
Number of processors for PARMETIS/PT-SCOTCH. Only used if the ordering == 0.
Definition pexsi_solver.h:61
const double get_totalFreeEnergy() const
int nb
Definition pexsi_solver.h:132
static int pexsi_row_ordering
row permutation strategy for factorization and selected inversion.
Definition pexsi_solver.h:57
double * EDM
Definition pexsi_solver.h:140
static bool pexsi_symm
Matrix structure.
Definition pexsi_solver.h:67
static int pexsi_nmax
Maximum number of PEXSI iterations after each inertia counting procedure.
Definition pexsi_solver.h:41
static int pexsi_nproc_pole
The point parallelizaion of PEXSI.
Definition pexsi_solver.h:84
double mu
Definition pexsi_solver.h:144
const double get_mu() const
static int pexsi_method
The pole expansion method to be used.
Definition pexsi_solver.h:79
static bool pexsi_comm
Whether to construct PSelInv communication pattern.
Definition pexsi_solver.h:45
int nlocal
global dimension of the NAO Hamiltonian
Definition pexsi_solver.h:135
Definition dist_bcd_matrix.h:12