Skip to content

Commit 00ba221

Browse files
committed
add back rdmft
1 parent 07c4c20 commit 00ba221

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

source/module_esolver/lcao_after_scf.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "esolver_ks_lcao.h"
2-
#include "module_rdmft/rdmft.h" // RDMFT codes
32

43
#include "module_base/formatter.h"
54
#include "module_base/global_variable.h"
@@ -10,8 +9,6 @@
109
#include "module_io/nscf_band.h"
1110
#include "module_io/output_log.h"
1211
#include "module_io/output_sk.h"
13-
#include "module_io/to_wannier90_lcao.h"
14-
#include "module_io/to_wannier90_lcao_in_pw.h"
1512
#include "module_io/write_elecstat_pot.h"
1613
#include "module_parameter/parameter.h"
1714
#include "module_base/global_function.h"
@@ -22,15 +19,7 @@
2219
#include "module_io/print_info.h"
2320

2421
#include <memory>
25-
#ifdef __EXX
26-
#include "module_io/restart_exx_csr.h"
27-
#include "module_ri/RPA_LRI.h"
28-
#endif
2922

30-
#ifdef __DEEPKS
31-
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h"
32-
#include "module_hamilt_lcao/module_deepks/LCAO_deepks_interface.h"
33-
#endif
3423
//-----force& stress-------------------
3524
#include "module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.h"
3625

source/module_io/ctrl_output_lcao.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#include "module_io/berryphase.h" // use berryphase
1818
#include "module_io/to_wannier90_lcao.h" // use toWannier90_LCAO
1919
#include "module_io/to_wannier90_lcao_in_pw.h" // use toWannier90_LCAO_IN_PW
20+
#ifdef __EXX
21+
//#include "module_io/restart_exx_csr.h"
22+
#include "module_ri/RPA_LRI.h" // use RPA code
23+
#endif
24+
#include "module_rdmft/rdmft.h" // use RDMFT codes
2025
#include "module_io/to_qo.h" // use toQO
2126

2227
namespace ModuleIO
@@ -38,6 +43,7 @@ void ctrl_output_lcao(UnitCell& ucell,
3843
Grid_Technique &gt, // for berryphase
3944
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
4045
const Structure_Factor& sf, // for Wannier90
46+
rdmft::RDMFT<TK, TR> &rdmft_solver, // for RDMFT
4147
const int istep)
4248
{
4349
ModuleBase::TITLE("ModuleIO", "ctrl_output_lcao");
@@ -340,34 +346,32 @@ void ctrl_output_lcao(UnitCell& ucell,
340346
}
341347
#endif
342348

343-
/*
344349
//------------------------------------------------------------------
345350
//! 18) Perform RDMFT calculations, added by jghan, 2024-10-17
346351
//------------------------------------------------------------------
347352
if (PARAM.inp.rdmft == true)
348353
{
349-
ModuleBase::matrix occ_num(this->pelec->wg);
354+
ModuleBase::matrix occ_num(pelec->wg);
350355
for (int ik = 0; ik < occ_num.nr; ++ik)
351356
{
352357
for (int inb = 0; inb < occ_num.nc; ++inb)
353358
{
354-
occ_num(ik, inb) /= this->kv.wk[ik];
359+
occ_num(ik, inb) /= kv.wk[ik];
355360
}
356361
}
357-
this->rdmft_solver.update_elec(ucell, occ_num, *(this->psi));
362+
rdmft_solver.update_elec(ucell, occ_num, *psi);
358363

359364
//! initialize the gradients of Etotal with respect to occupation numbers and wfc,
360365
//! and set all elements to 0.
361366
//! dedocc = d E/d Occ_Num
362-
ModuleBase::matrix dedocc(this->pelec->wg.nr, this->pelec->wg.nc, true);
367+
ModuleBase::matrix dedocc(pelec->wg.nr, pelec->wg.nc, true);
363368

364369
//! dedwfc = d E/d wfc
365-
psi::Psi<TK> dedwfc(this->psi->get_nk(), this->psi->get_nbands(), this->psi->get_nbasis(), this->kv.ngk, true);
370+
psi::Psi<TK> dedwfc(psi->get_nk(), psi->get_nbands(), psi->get_nbasis(), kv.ngk, true);
366371
dedwfc.zero_out();
367372

368-
double etot_rdmft = this->rdmft_solver.run(dedocc, dedwfc);
373+
double etot_rdmft = rdmft_solver.run(dedocc, dedwfc);
369374
}
370-
*/
371375

372376
//------------------------------------------------------------------
373377
//! Output quasi orbitals
@@ -409,6 +413,7 @@ template void ModuleIO::ctrl_output_lcao<double, double>(UnitCell& ucell,
409413
Grid_Technique &gt, // for berryphase
410414
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
411415
const Structure_Factor& sf, // for Wannier90
416+
rdmft::RDMFT<double, double> &rdmft_solver, // for RDMFT
412417
const int istep);
413418

414419
// For multiple k-points
@@ -427,6 +432,7 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, double>(UnitCell&
427432
Grid_Technique &gt, // for berryphase
428433
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
429434
const Structure_Factor& sf, // for Wannier90
435+
rdmft::RDMFT<std::complex<double>, double> &rdmft_solver, // for RDMFT
430436
const int istep);
431437

432438
template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<double>>(UnitCell& ucell,
@@ -444,5 +450,6 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<doub
444450
Grid_Technique &gt, // for berryphase
445451
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
446452
const Structure_Factor& sf, // for Wannier90
453+
rdmft::RDMFT<std::complex<double>, std::complex<double>> &rdmft_solver, // for RDMFT
447454
const int istep);
448455

source/module_io/ctrl_output_lcao.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "module_hamilt_lcao/module_gint/gint_k.h" // use Gint_k
1313
#include "module_basis/module_pw/pw_basis_k.h" // use ModulePW::PW_Basis_K and ModulePW::PW_Basis
1414
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h" // use Structure_Factor
15+
#include "module_rdmft/rdmft.h" // use RDMFT codes
1516

1617
namespace ModuleIO
1718
{
@@ -32,6 +33,7 @@ namespace ModuleIO
3233
Grid_Technique &gt, // for berryphase
3334
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
3435
const Structure_Factor& sf, // for Wannier90
36+
rdmft::RDMFT<TK, TR> &rdmft_solver, // for RDMFT
3537
const int istep);
3638
}
3739
#endif

0 commit comments

Comments
 (0)