ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_ks_lcao_tddft.h
Go to the documentation of this file.
1#ifndef ESOLVER_KS_LCAO_TDDFT_H
2#define ESOLVER_KS_LCAO_TDDFT_H
3#include "esolver_ks.h"
4#include "esolver_ks_lcao.h"
6#include "source_lcao/module_rt/gather_mat.h" // MPI gathering and distributing functions
9
10namespace ModuleESolver
11{
12
13template <typename TR, typename Device = base_device::DEVICE_CPU>
14class ESolver_KS_LCAO_TDDFT : public ESolver_KS_LCAO<std::complex<double>, TR>
15{
16 public:
18
20
21 void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
22
23 protected:
24 virtual void runner(UnitCell& cell, const int istep) override;
25
26 virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override;
27
28 void store_h_s_psi(UnitCell& ucell, const int istep, const int iter, const bool conv_esolver);
29
30 void iter_finish(UnitCell& ucell,
31 const int istep,
32 const int estep,
33 const int estep_max,
34 int& iter,
35 bool& conv_esolver);
36
37 virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override;
38
39 void print_step();
40
43
45 ct::Tensor Hk_laststep = ct::Tensor(ct::DataType::DT_COMPLEX_DOUBLE);
46
48 ct::Tensor Sk_laststep = ct::Tensor(ct::DataType::DT_COMPLEX_DOUBLE);
49
51 bool use_tensor = false;
52 bool use_lapack = false;
53
54 // Control the device type for Hk_laststep and Sk_laststep
55 // Set to CPU temporarily, should wait for further GPU development
56 static constexpr ct::DeviceType ct_device_type_hs = ct::DeviceType::CpuDevice;
57
59 int totstep = -1;
60
63
64 TD_info* td_p = nullptr;
65
67 bool restart_done = false;
68
69 private:
70 void weight_dm_rho(const UnitCell& ucell);
71};
72
73} // namespace ModuleESolver
74#endif // ESOLVER_KS_LCAO_TDDFT_H
Definition esolver_ks_lcao_tddft.h:15
ct::Tensor Sk_laststep
Overlap matrix for all k-points of last time step.
Definition esolver_ks_lcao_tddft.h:48
void store_h_s_psi(UnitCell &ucell, const int istep, const int iter, const bool conv_esolver)
Definition esolver_ks_lcao_tddft.cpp:326
~ESolver_KS_LCAO_TDDFT()
Definition esolver_ks_lcao_tddft.cpp:38
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Definition esolver_ks_lcao_tddft.cpp:212
void iter_finish(UnitCell &ucell, const int istep, const int estep, const int estep_max, int &iter, bool &conv_esolver)
Definition esolver_ks_lcao_tddft.cpp:287
bool restart_done
Restart flag.
Definition esolver_ks_lcao_tddft.h:67
virtual void runner(UnitCell &cell, const int istep) override
run energy solver
Definition esolver_ks_lcao_tddft.cpp:81
void print_step()
Definition esolver_ks_lcao_tddft.cpp:204
psi::Psi< std::complex< double > > * psi_laststep
Wave function for all k-points of last time step.
Definition esolver_ks_lcao_tddft.h:42
void weight_dm_rho(const UnitCell &ucell)
Definition esolver_ks_lcao_tddft.cpp:470
static constexpr ct::DeviceType ct_device_type_hs
Definition esolver_ks_lcao_tddft.h:56
Velocity_op< TR > * velocity_mat
Velocity matrix for calculating current.
Definition esolver_ks_lcao_tddft.h:62
ESolver_KS_LCAO_TDDFT()
Definition esolver_ks_lcao_tddft.cpp:23
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Something to do after SCF iterations when SCF is converged or comes to the max iter step.
Definition esolver_ks_lcao_tddft.cpp:441
bool use_tensor
Control heterogeneous computing of the TDDFT solver.
Definition esolver_ks_lcao_tddft.h:51
TD_info * td_p
Definition esolver_ks_lcao_tddft.h:64
ct::Tensor Hk_laststep
Hamiltonian for all k-points of last time step.
Definition esolver_ks_lcao_tddft.h:45
bool use_lapack
Definition esolver_ks_lcao_tddft.h:52
void before_all_runners(UnitCell &ucell, const Input_para &inp) override
Initialize of the first-principels energy solver.
Definition esolver_ks_lcao_tddft.cpp:53
int totstep
Total steps for evolving the wave function.
Definition esolver_ks_lcao_tddft.h:59
Definition esolver_ks_lcao.h:32
bool conv_esolver
Definition esolver.h:47
Definition td_info.h:10
Definition unitcell.h:17
Definition velocity_op.h:15
A multi-dimensional array of elements of a single data type.
Definition tensor.h:32
Definition psi.h:37
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
DeviceType
The type of memory used by an allocator.
Definition tensor_types.h:73
Definition input_parameter.h:13