ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Exx_LRI_interface.hpp
Go to the documentation of this file.
1#ifndef EXX_LRI_INTERFACE_HPP
2#define EXX_LRI_INTERFACE_HPP
4
5#include "Exx_LRI_interface.h"
11
15
16#include <sys/time.h>
17#include <stdexcept>
18#include <string>
19
20/*
21template<typename T, typename Tdata>
22void Exx_LRI_Interface<T, Tdata>::write_Hexxs_cereal(const std::string& file_name) const
23{
24 ModuleBase::TITLE("Exx_LRI_Interface", "write_Hexxs_cereal");
25 ModuleBase::timer::tick("Exx_LRI_Interface", "write_Hexxs_cereal");
26 std::ofstream ofs(file_name + "_" + std::to_string(GlobalV::MY_RANK), std::ofstream::binary);
27 cereal::BinaryOutputArchive oar(ofs);
28 oar(this->exx_ptr->Hexxs);
29 ModuleBase::timer::tick("Exx_LRI_Interface", "write_Hexxs_cereal");
30}
31
32template<typename T, typename Tdata>
33void Exx_LRI_Interface<T, Tdata>::read_Hexxs_cereal(const std::string& file_name)
34{
35 ModuleBase::TITLE("Exx_LRI_Interface", "read_Hexxs_cereal");
36 ModuleBase::timer::tick("Exx_LRI_Interface", "read_Hexxs_cereal");
37 const std::string file_name_rank = file_name + "_" + std::to_string(GlobalV::MY_RANK);
38 std::ifstream ifs(file_name_rank, std::ofstream::binary);
39 if(!ifs.is_open())
40 { ModuleBase::WARNING_QUIT("Exx_LRI_Interface", file_name_rank+" not found."); }
41 cereal::BinaryInputArchive iar(ifs);
42 iar(this->exx_ptr->Hexxs);
43 ModuleBase::timer::tick("Exx_LRI_Interface", "read_Hexxs_cereal");
44}
45*/
46
47template<typename T, typename Tdata>
48void Exx_LRI_Interface<T, Tdata>::init(const MPI_Comm &mpi_comm,
49 const UnitCell &ucell,
50 const K_Vectors &kv,
51 const LCAO_Orbitals& orb)
52{
53 ModuleBase::TITLE("Exx_LRI_Interface","init");
54 this->exx_ptr->init(mpi_comm, ucell, kv, orb);
55 this->flag_finish.init = true;
56}
57
58template<typename T, typename Tdata>
59void Exx_LRI_Interface<T, Tdata>::cal_exx_ions(const UnitCell& ucell, const bool write_cv)
60{
61 ModuleBase::TITLE("Exx_LRI_Interface","cal_exx_ions");
62 if(!this->flag_finish.init)
63 { throw std::runtime_error("Exx init unfinished when "+std::string(__FILE__)+" line "+std::to_string(__LINE__)); }
64
65 this->exx_ptr->cal_exx_ions(ucell, write_cv);
66
67 this->flag_finish.ions = true;
68}
69
70template<typename T, typename Tdata>
71void Exx_LRI_Interface<T, Tdata>::cal_exx_elec(const std::vector<std::map<TA, std::map<TAC, RI::Tensor<Tdata>>>>& Ds,
72 const UnitCell& ucell,
73 const Parallel_Orbitals& pv,
75{
76 ModuleBase::TITLE("Exx_LRI_Interface","cal_exx_elec");
77 if(!this->flag_finish.init || !this->flag_finish.ions)
78 {
79 throw std::runtime_error("Exx init unfinished when "
80 +std::string(__FILE__)+" line "+std::to_string(__LINE__));
81 }
82
83 this->exx_ptr->cal_exx_elec(Ds, ucell, pv, p_symrot);
84
85 this->flag_finish.elec = true;
86}
87
88template<typename T, typename Tdata>
90{
91 ModuleBase::TITLE("Exx_LRI_Interface","cal_exx_force");
92 if(!this->flag_finish.init || !this->flag_finish.ions)
93 {
94 throw std::runtime_error("Exx init unfinished when "+std::string(__FILE__)+" line "+std::to_string(__LINE__));
95 }
96 if(!this->flag_finish.elec)
97 {
98 throw std::runtime_error("Exx Hamiltonian unfinished when "+std::string(__FILE__)
99 +" line "+std::to_string(__LINE__));
100 }
101
102 this->exx_ptr->cal_exx_force(nat);
103
104 this->flag_finish.force = true;
105}
106
107template<typename T, typename Tdata>
108void Exx_LRI_Interface<T, Tdata>::cal_exx_stress(const double& omega, const double& lat0)
109{
110 ModuleBase::TITLE("Exx_LRI_Interface","cal_exx_stress");
111 if(!this->flag_finish.init || !this->flag_finish.ions)
112 {
113 throw std::runtime_error("Exx init unfinished when "
114 +std::string(__FILE__)+" line "+std::to_string(__LINE__));
115 }
116 if(!this->flag_finish.elec)
117 {
118 throw std::runtime_error("Exx Hamiltonian unfinished when "
119 +std::string(__FILE__)+" line "+std::to_string(__LINE__));
120 }
121
122 this->exx_ptr->cal_exx_stress(omega, lat0);
123
124 this->flag_finish.stress = true;
125}
126
127template<typename T, typename Tdata>
129 const K_Vectors& kv,
130 const UnitCell& ucell,
131 const Parallel_2D& pv)
132{
133 ModuleBase::TITLE("Exx_LRI_Interface","exx_before_all_runners");
134 // initialize the rotation matrix in AO representation
135 this->exx_spacegroup_symmetry = (PARAM.inp.nspin < 4 && ModuleSymmetry::Symmetry::symm_flag == 1);
136 if (this->exx_spacegroup_symmetry)
137 {
138 const std::array<int, 3>& period = RI_Util::get_Born_vonKarmen_period(kv);
139 this->symrot_.find_irreducible_sector(
140 ucell.symm, ucell.atoms, ucell.st,
141 RI_Util::get_Born_von_Karmen_cells(period), period, ucell.lat);
142 this->symrot_.set_abfs_Lmax(GlobalC::exx_info.info_ri.abfs_Lmax);
143 this->symrot_.cal_Ms(kv, ucell, pv);
144 }
145}
146
147template<typename T, typename Tdata>
149 const K_Vectors& kv,
150 const Charge_Mixing& chgmix,
151 const UnitCell& ucell,
152 const LCAO_Orbitals& orb)
153{
154 ModuleBase::TITLE("Exx_LRI_Interface","exx_beforescf");
155#ifdef __MPI
156 if (GlobalC::exx_info.info_global.cal_exx)
157 {
158 if ((GlobalC::restart.info_load.load_H_finish && !GlobalC::restart.info_load.restart_exx)
159 || (istep > 0)
160 || (PARAM.inp.init_wfc == "file"))
161 {
163 }
164 else
165 {
166 if (ucell.atoms[0].ncpp.xc_func == "HF" || ucell.atoms[0].ncpp.xc_func == "PBE0" || ucell.atoms[0].ncpp.xc_func == "HSE")
167 {
169 }
170 else if (ucell.atoms[0].ncpp.xc_func == "SCAN0")
171 {
173 }
174 // added by jghan, 2024-07-07
175 else if ( ucell.atoms[0].ncpp.xc_func == "MULLER" || ucell.atoms[0].ncpp.xc_func == "POWER"
176 || ucell.atoms[0].ncpp.xc_func == "WP22" || ucell.atoms[0].ncpp.xc_func == "CWP22" )
177 {
179 }
180 }
181
182 this->cal_exx_ions(ucell,PARAM.inp.out_ri_cv);
183 }
184
185 // set initial parameter for mix_DMk_2D
186 if(GlobalC::exx_info.info_global.cal_exx)
187 {
188 if (this->exx_spacegroup_symmetry)
189 {this->mix_DMk_2D.set_nks(kv.get_nkstot_full() * (PARAM.inp.nspin == 2 ? 2 : 1), PARAM.globalv.gamma_only_local);}
190 else
191 {this->mix_DMk_2D.set_nks(kv.get_nks(), PARAM.globalv.gamma_only_local);}
192
193 if(GlobalC::exx_info.info_global.separate_loop)
194 { this->mix_DMk_2D.set_mixing(nullptr); }
195 else
196 { this->mix_DMk_2D.set_mixing(chgmix.get_mixing()); }
197 // for exx two_level scf
198 this->two_level_step = 0;
199 }
200#endif // __MPI
201}
202
203template<typename T, typename Tdata>
205 const UnitCell& ucell,
207 const K_Vectors& kv,
208 const int& iter)
209{
210 ModuleBase::TITLE("Exx_LRI_Interface","exx_eachiterinit");
211 if (GlobalC::exx_info.info_global.cal_exx)
212 {
213 if (!GlobalC::exx_info.info_global.separate_loop
214 && (this->two_level_step
215 || istep > 0
216 || PARAM.inp.init_wfc == "file") // non separate loop case
218 && PARAM.inp.init_wfc == "file"
219 && this->two_level_step == 0
220 && iter == 1)
221 ) // the first iter in separate loop case
222 {
223 const bool flag_restart = (iter == 1) ? true : false;
224
225 auto cal = [this, &ucell,&kv, &flag_restart](const elecstate::DensityMatrix<T, double>& dm_in)
226 {
227 if (this->exx_spacegroup_symmetry)
228 { this->mix_DMk_2D.mix(symrot_.restore_dm(kv,dm_in.get_DMK_vector(), *dm_in.get_paraV_pointer()), flag_restart); }
229 else
230 { this->mix_DMk_2D.mix(dm_in.get_DMK_vector(), flag_restart); }
231 const std::vector<std::map<TA, std::map<TAC, RI::Tensor<Tdata>>>>
233 ? RI_2D_Comm::split_m2D_ktoR<Tdata>(
234 ucell,
235 *this->exx_ptr->p_kv,
236 this->mix_DMk_2D.get_DMk_gamma_out(),
237 *dm_in.get_paraV_pointer(),
239 : RI_2D_Comm::split_m2D_ktoR<Tdata>(
240 ucell,
241 *this->exx_ptr->p_kv,
242 this->mix_DMk_2D.get_DMk_k_out(),
243 *dm_in.get_paraV_pointer(),
245 this->exx_spacegroup_symmetry);
246
247 if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace)
248 { this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer(), &this->symrot_); }
249 else
250 { this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer()); }
251 };
252
253 if(istep > 0 && flag_restart)
254 { cal(*dm_last_step); }
255 else
256 { cal(dm); }
257 }
258 }
259}
260
261template<typename T, typename Tdata>
263{
264 ModuleBase::TITLE("Exx_LRI_Interface","exx_hamilt2density");
265 // Peize Lin add 2020.04.04
267 {
268 // add exx
269 // Peize Lin add 2016-12-03
270 if (GlobalC::restart.info_load.load_H_finish && !GlobalC::restart.info_load.restart_exx
271 && this->two_level_step == 0 && iter == 1)
272 {
273 if (GlobalV::MY_RANK == 0)
274 {
275 try
276 { GlobalC::restart.load_disk("Eexx", 0, 1, &this->exx_ptr->Eexx); }
277 catch (const std::exception& e)
278 { std::cout << "WARNING: Cannot read Eexx from disk, the energy of the 1st loop will be wrong, sbut it does not influence the subsequent loops." << std::endl; }
279 }
280 Parallel_Common::bcast_double(this->exx_ptr->Eexx);
281 this->exx_ptr->Eexx /= GlobalC::exx_info.info_global.hybrid_alpha;
282 }
283 elec.set_exx(this->get_Eexx());
284 }
285 else
286 {
287 elec.f_en.exx = 0.;
288 }
289}
290
291template<typename T, typename Tdata>
293 const UnitCell& ucell,
296 Charge_Mixing& chgmix,
297 const double& scf_ene_thr,
298 int& iter,
299 const int istep,
300 bool& conv_esolver)
301{
302 ModuleBase::TITLE("Exx_LRI_Interface","exx_iter_finish");
303 if (GlobalC::restart.info_save.save_H && (this->two_level_step > 0 || istep > 0)
304 && (!GlobalC::exx_info.info_global.separate_loop || iter == 1)) // to avoid saving the same value repeatedly
305 {
307 /*
308 hamilt::HS_Matrix_K<TK> Hexxk_save(&this->pv, 1);
309 for (int ik = 0; ik < this->kv.get_nks(); ++ik) {
310 Hexxk_save.set_zero_hk();
311
312 hamilt::OperatorEXX<hamilt::OperatorLCAO<TK, TR>> opexx_save(&Hexxk_save,
313 nullptr,
314 this->kv);
315
316 opexx_save.contributeHk(ik);
317
318 GlobalC::restart.save_disk("Hexx",
319 ik,
320 this->pv.get_local_size(),
321 Hexxk_save.get_hk());
322 }*/
324 const std::string& restart_HR_path = GlobalC::restart.folder + "HexxR" + std::to_string(GlobalV::MY_RANK);
325 ModuleIO::write_Hexxs_csr(restart_HR_path, ucell, this->get_Hexxs());
326
327 if (GlobalV::MY_RANK == 0)
328 {
329 GlobalC::restart.save_disk("Eexx", 0, 1, &elec.f_en.exx);
330 }
331 }
332
333 if (GlobalC::exx_info.info_global.cal_exx && conv_esolver)
334 {
335 // Kerker mixing does not work for the density matrix.
336 // In the separate loop case, it can still work in the subsequent inner loops where Hexx(DM) is fixed.
337 // In the non-separate loop case where Hexx(DM) is updated in every iteration of the 2nd loop, it should be
338 // closed.
339 if (!GlobalC::exx_info.info_global.separate_loop)
340 {
341 chgmix.close_kerker_gg0();
342 }
343 this->dm_last_step = dynamic_cast<const elecstate::ElecStateLCAO<T>*>(&elec)->get_DM();
344 conv_esolver = this->exx_after_converge(
345 ucell,
346 hamilt,
347 *dynamic_cast<const elecstate::ElecStateLCAO<T>*>(&elec)->get_DM(),
348 kv,
350 iter,
351 istep,
352 elec.f_en.etot,
353 scf_ene_thr);
354 }
355 //else if ( PARAM.inp.rdmft && two_level_step ) { conv_esolver = true; } // for RDMFT in the future to quit after the first iter of the exx-loop
356}
357
358template<typename T, typename Tdata>
360 const UnitCell& ucell,
363 const K_Vectors& kv,
364 const int& nspin,
365 int& iter,
366 const int& istep,
367 const double& etot,
368 const double& scf_ene_thr)
369{ // only called if (GlobalC::exx_info.info_global.cal_exx)
370 ModuleBase::TITLE("Exx_LRI_Interface","exx_after_converge");
371 auto restart_reset = [this]()
372 { // avoid calling restart related procedure in the subsequent ion steps
374 this->exx_ptr->Eexx = 0;
375 };
376
377 // no separate_loop case
378 if (!GlobalC::exx_info.info_global.separate_loop)
379 {
381
382 // in no_separate_loop case, scf loop only did twice
383 // in first scf loop, exx updated once in beginning,
384 // in second scf loop, exx updated every iter
385
386 if (this->two_level_step || istep > 0)
387 {
388 restart_reset();
389 return true;
390 }
391 else
392 {
393 // update exx and redo scf
395 iter = 0;
396 std::cout << " Entering 2nd SCF, where EXX is updated" << std::endl;
397 this->two_level_step++;
398 return false;
399 }
400 }
401 else
402 { // has separate_loop case
403 const double ediff = std::abs(etot - etot_last_outer_loop) * ModuleBase::Ry_to_eV;
404 if (two_level_step)
405 { std::cout << FmtCore::format(" deltaE (eV) from outer loop: %.8e \n", ediff); }
406 // exx converged or get max exx steps
407 if (this->two_level_step == GlobalC::exx_info.info_global.hybrid_step
408 || (iter == 1 && this->two_level_step != 0) // density convergence of outer loop
409 || (ediff < scf_ene_thr && this->two_level_step != 0)) //energy convergence of outer loop
410 {
411 restart_reset();
412 return true;
413 }
414 else
415 {
416 this->etot_last_outer_loop = etot;
417 // update exx and redo scf
418 if (this->two_level_step == 0)
420
421 std::cout << " Updating EXX " << std::flush;
422 timeval t_start; gettimeofday(&t_start, nullptr);
423
424 // if init_wfc == "file", DM is calculated in the 1st iter of the 1st two-level step, so we mix it here
425 const bool flag_restart = (this->two_level_step == 0 && PARAM.inp.init_wfc != "file") ? true : false;
426
427 if (this->exx_spacegroup_symmetry)
428 {this->mix_DMk_2D.mix(symrot_.restore_dm(kv, dm.get_DMK_vector(), *dm.get_paraV_pointer()), flag_restart);}
429 else
430 {this->mix_DMk_2D.mix(dm.get_DMK_vector(), flag_restart);}
431
432 // GlobalC::exx_lcao.cal_exx_elec(p_esolver->LOC, p_esolver->LOWF.wfc_k_grid);
433 const std::vector<std::map<int, std::map<std::pair<int, std::array<int, 3>>, RI::Tensor<Tdata>>>>
434 Ds = std::is_same<T, double>::value //gamma_only_local
435 ? RI_2D_Comm::split_m2D_ktoR<Tdata>(ucell,*this->exx_ptr->p_kv, this->mix_DMk_2D.get_DMk_gamma_out(), *dm.get_paraV_pointer(), nspin)
436 : RI_2D_Comm::split_m2D_ktoR<Tdata>(ucell,*this->exx_ptr->p_kv, this->mix_DMk_2D.get_DMk_k_out(), *dm.get_paraV_pointer(), nspin, this->exx_spacegroup_symmetry);
437
438 if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace)
439 { this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer(), &this->symrot_); }
440 else
441 { this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer()); } // restore DM but not Hexx
442 iter = 0;
443 this->two_level_step++;
444
445 timeval t_end; gettimeofday(&t_end, nullptr);
446 std::cout << "and rerun SCF\t"
447 << std::setprecision(3) << std::setiosflags(std::ios::scientific)
448 << (double)(t_end.tv_sec-t_start.tv_sec) + (double)(t_end.tv_usec-t_start.tv_usec)/1000000.0
449 << std::defaultfloat << " (s)" << std::endl;
450 return false;
451 }
452 } // if(GlobalC::exx_info.info_global.separate_loop)
453 restart_reset();
454 return true;
455}
456
457#endif
Atom_pseudo ncpp
Definition atom_spec.h:13
Definition charge_mixing.h:9
Base_Mixing::Mixing * get_mixing() const
Definition charge_mixing.h:103
void close_kerker_gg0()
Definition charge_mixing.h:52
void cal_exx_force(const int &nat)
: in cal_exx_force: Exx_LRI::cal_exx_force()
Definition Exx_LRI_interface.hpp:89
void cal_exx_stress(const double &omega, const double &lat0)
: in cal_exx_stress: Exx_LRI::cal_exx_stress()
Definition Exx_LRI_interface.hpp:108
void exx_beforescf(const int istep, const K_Vectors &kv, const Charge_Mixing &chgmix, const UnitCell &ucell, const LCAO_Orbitals &orb)
in beforescf: set xc type, opt_orb, do DM mixing
Definition Exx_LRI_interface.hpp:148
std::pair< TA, TC > TAC
Definition Exx_LRI_interface.h:36
void cal_exx_ions(const UnitCell &ucell, const bool write_cv=false)
: in cal_exx_ions: Exx_LRI::cal_exx_ions()
Definition Exx_LRI_interface.hpp:59
void init(const MPI_Comm &mpi_comm, const UnitCell &ucell, const K_Vectors &kv, const LCAO_Orbitals &orb)
in init: Exx_LRI::init()
Definition Exx_LRI_interface.hpp:48
void exx_hamilt2rho(elecstate::ElecState &elec, const Parallel_Orbitals &pv, const int iter)
in hamilt2rho: calculate Hexx and Eexx
Definition Exx_LRI_interface.hpp:262
void exx_iter_finish(const K_Vectors &kv, const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, elecstate::ElecState &elec, Charge_Mixing &chgmix, const double &scf_ene_thr, int &iter, const int istep, bool &conv_esolver)
in iter_finish: write Hexx, do something according to whether SCF is converged
Definition Exx_LRI_interface.hpp:292
bool exx_after_converge(const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, const elecstate::DensityMatrix< T, double > &dm, const K_Vectors &kv, const int &nspin, int &iter, const int &istep, const double &etot, const double &scf_ene_thr)
: in do_after_converge: add exx operators; do DM mixing if seperate loop
Definition Exx_LRI_interface.hpp:359
void exx_before_all_runners(const K_Vectors &kv, const UnitCell &ucell, const Parallel_2D &pv)
in before_all_runners: set symmetry according to irreducible k-points since k-points are not reduced ...
Definition Exx_LRI_interface.hpp:128
void exx_eachiterinit(const int istep, const UnitCell &ucell, const elecstate::DensityMatrix< T, double > &dm, const K_Vectors &kv, const int &iter)
in eachiterinit: do DM mixing and calculate Hexx when entering 2nd SCF
Definition Exx_LRI_interface.hpp:204
int TA
Definition Exx_LRI_interface.h:34
void cal_exx_elec(const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Ds, const UnitCell &ucell, const Parallel_Orbitals &pv, const ModuleSymmetry::Symmetry_rotation *p_symrot=nullptr)
: in cal_exx_elec: Exx_LRI::cal_exx_elec()
Definition Exx_LRI_interface.hpp:71
static std::string format(const char *fmt, const Ts &... args)
static function to format data
Definition formatter.h:41
Definition klist.h:13
int get_nkstot_full() const
Definition klist.h:78
int get_nks() const
Definition klist.h:68
Definition ORB_read.h:19
Definition symmetry_rotation.h:16
static int symm_flag
Definition symmetry.h:30
This class packs the basic information of 2D-block-cyclic parallel distribution of an arbitrary matri...
Definition parallel_2d.h:12
Definition parallel_orbitals.h:9
const Input_para & inp
Definition parameter.h:26
const System_para & globalv
Definition parameter.h:30
std::string folder
Definition restart.h:31
Info_Load info_load
Definition restart.h:29
bool load_disk(const std::string label, const int index, const int size, T *data, const bool error_quit=true) const
Definition restart.h:43
bool save_disk(const std::string label, const int index, const int size, T *data, const bool error_quit=true) const
Definition restart.h:34
Definition unitcell.h:16
Atom * atoms
Definition unitcell.h:18
Lattice lat
Definition unitcell.h:25
ModuleSymmetry::Symmetry symm
Definition unitcell.h:55
Statistics st
Definition unitcell.h:44
static int get_func_type()
Definition xc_functional.h:67
static void set_xc_type(const std::string xc_func_in)
Definition xc_functional.cpp:48
Definition density_matrix.h:36
const std::vector< std::vector< TK > > & get_DMK_vector() const
get pointer vector of DMK
Definition density_matrix.h:161
const Parallel_Orbitals * get_paraV_pointer() const
get pointer of paraV
Definition density_matrix.h:173
Definition elecstate_lcao.h:15
Definition elecstate.h:15
fenergy f_en
energies contribute to the total free energy
Definition elecstate.h:157
void set_exx(const double &Eexx)
calculation if converged
Definition elecstate_exx.cpp:8
Definition hamilt.h:16
std::string xc_func
Definition pseudo.h:25
a new formatter library for formatting data
Exx_Info exx_info
Definition test_xc.cpp:29
Restart restart
Definition for_testing_input_conv.h:255
int MY_RANK
global index of process
Definition global_variable.cpp:21
const double Ry_to_eV
Definition constants.h:81
void TITLE(const std::string &class_name, const std::string &function_name, const bool disable)
Definition tool_title.cpp:18
void write_Hexxs_csr(const std::string &file_name, const UnitCell &ucell, const std::map< int, std::map< TAC, RI::Tensor< Tdata > > > &Hexxs)
write Hexxs in CSR format
void bcast_double(double *object, const int n)
Definition parallel_common.cpp:49
std::array< int, 3 > get_Born_vonKarmen_period(const K_Vectors &kv)
Definition RI_Util.hpp:16
std::vector< std::array< Tcell, Ndim > > get_Born_von_Karmen_cells(const std::array< Tcell, Ndim > &Born_von_Karman_period)
Definition RI_Util.hpp:34
Definition hamilt.h:12
Parameter PARAM
Definition parameter.cpp:3
bool separate_loop
Definition exx_info.h:35
double hybrid_alpha
Definition exx_info.h:31
size_t hybrid_step
Definition exx_info.h:36
Exx_Info_Global info_global
Definition exx_info.h:38
std::string init_wfc
"file","atomic","random"
Definition input_parameter.h:47
int nspin
LDA ; LSDA ; non-linear spin.
Definition input_parameter.h:84
bool out_ri_cv
Whether to output the coefficient tensor C and ABFs-representation Coulomb matrix V.
Definition input_parameter.h:551
bool restart_exx
Definition restart.h:27
bool gamma_only_local
Definition system_parameter.h:38
double etot
the total free energy
Definition fp_energy.h:18
double exx
the exact exchange energy.
Definition fp_energy.h:31