Skip to content

Commit 3c54bab

Browse files
authored
Update rdmft.h (#5628)
1 parent d236215 commit 3c54bab

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

source/module_rdmft/rdmft.h

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#ifndef RDMFT_H
66
#define RDMFT_H
77

8-
98
#include "module_parameter/parameter.h"
109
#include "module_hamilt_pw/hamilt_pwdft/global.h"
1110
#include "module_psi/psi.h"
@@ -36,12 +35,10 @@
3635
#include <vector>
3736
#include <iomanip>
3837

39-
40-
38+
//! Reduced Density Matrix Functional Theory (RDMFT)
4139
namespace rdmft
4240
{
4341

44-
4542
template <typename TK, typename TR>
4643
class RDMFT
4744
{
@@ -51,27 +48,34 @@ class RDMFT
5148
~RDMFT();
5249

5350
const Parallel_Orbitals* ParaV = nullptr;
51+
5452
Parallel_2D para_Eij;
55-
elecstate::ElecState* pelec = nullptr; // just to gain Ewald and this->pelec->pot
56-
const K_Vectors* kv = nullptr; // update after ion step
53+
54+
//! obain Ewald and this->pelec->pot
55+
elecstate::ElecState* pelec = nullptr;
56+
57+
//! update after ion step
58+
const K_Vectors* kv = nullptr;
5759

5860
int nk_total = 0;
5961
int nbands_total;
6062
int nspin = 1;
6163
std::string XC_func_rdmft;
62-
double alpha_power = 0.656; // 0.656 for soilds, 0.525 for dissociation of H2, 0.55~0.58 for HEG
6364

64-
// natrual occupation numbers and wavefunction
65+
//! 0.656 for soilds, 0.525 for dissociation of H2, 0.55~0.58 for HEG
66+
double alpha_power = 0.656;
67+
68+
//! natrual occupation numbers and wavefunction
6569
ModuleBase::matrix occ_number;
6670
psi::Psi<TK> wfc;
6771
ModuleBase::matrix wg;
6872
ModuleBase::matrix wk_fun_occNum;
6973

70-
// store the gradients of Etotal with respect to the natural occupation numbers and wfc respectively
74+
//! gradients of total energy with respect to the natural occupation numbers and wfc
7175
ModuleBase::matrix occNum_wfcHamiltWfc;
7276
psi::Psi<TK> occNum_HamiltWfc;
7377

74-
// E_RDMFT[4] stores ETV, Ehartree, Exc, Etotal respectively
78+
//! E_RDMFT[4] stores ETV, Ehartree, Exc, Etotal
7579
double E_RDMFT[4] = {0.0};
7680
double Etotal = 0.0;
7781
// std::vector<double> E_RDMFT(4);
@@ -88,7 +92,7 @@ class RDMFT
8892
// Or we can use rdmft_solver.wfc/occ_number directly when optimizing, so that the update_elec() function does not require parameters.
8993
void update_elec(const ModuleBase::matrix& occ_number_in, const psi::Psi<TK>& wfc_in, const Charge* charge_in = nullptr);
9094

91-
//! get the gradient of total energy with respect to occupation number and wfc respectively
95+
//! obtain the gradient of total energy with respect to occupation number and wfc
9296
double cal_E_grad_wfc_occ_num();
9397

9498
void cal_Energy(const int cal_type = 1);
@@ -122,12 +126,14 @@ class RDMFT
122126

123127
private:
124128

129+
//! Hamiltonian matrices in real space
125130
hamilt::HContainer<TR>* HR_TV = nullptr;
126131
hamilt::HContainer<TR>* HR_hartree = nullptr;
127132
hamilt::HContainer<TR>* HR_dft_XC = nullptr;
128133
hamilt::HContainer<TR>* HR_exx_XC = nullptr;
129134
// hamilt::HContainer<TR>* HR_local = nullptr;
130135

136+
//! Hamiltonian matrices in reciprocal space
131137
hamilt::HS_Matrix_K<TK>* hsk_TV = nullptr;
132138
hamilt::HS_Matrix_K<TK>* hsk_hartree = nullptr;
133139
hamilt::HS_Matrix_K<TK>* hsk_dft_XC = nullptr;
@@ -175,7 +181,6 @@ class RDMFT
175181
bool only_exx_type = false;
176182
const int cal_E_type = 1; // cal_type = 2 just support XC-functional without exx
177183

178-
179184
/****** these parameters are passed in from outside, don't need delete ******/
180185
// GK and GG are used for multi-k grid integration and gamma only algorithms respectively
181186
Gint_k* GK = nullptr;
@@ -189,13 +194,7 @@ class RDMFT
189194
const ModuleBase::ComplexMatrix* sf = nullptr;
190195
const LCAO_Orbitals* orb = nullptr;
191196
const TwoCenterBundle* two_center_bundle = nullptr;
192-
193-
194197
};
195198

196-
197-
198199
}
199-
200-
201-
#endif
200+
#endif

0 commit comments

Comments
 (0)