1#ifndef ESOLVER_KS_LCAO_TDDFT_H
2#define ESOLVER_KS_LCAO_TDDFT_H
22template <
typename TR,
typename Device = base_device::DEVICE_CPU>
50 const double ethr)
override;
103 std::unique_ptr<module_rt::TD_MovingGauge>
td_mg_;
ct::Tensor Sk_laststep
Overlap matrix for all local k-points of the last electronic step.
Definition esolver_ks_lcao_tddft.h:81
void store_h_s_psi(UnitCell &ucell, const int istep, const int iter, const bool conv_esolver)
Save H, S, and wave functions when requested at convergence or the maximum iteration count.
Definition esolver_ks_lcao_tddft.cpp:532
~ESolver_KS_LCAO_TDDFT()
Release the saved wave functions, Hamiltonian, and solver-owned TD contexts.
Definition esolver_ks_lcao_tddft.cpp:42
bool use_td_moving_gauge
Moving spatial gauge for Ehrenfest dynamics, to calculate the correction term arising from the moveme...
Definition esolver_ks_lcao_tddft.h:101
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Obtain the density from initial-state diagonalization, loaded wave functions, or time propagation.
Definition esolver_ks_lcao_tddft.cpp:364
void iter_finish(UnitCell &ucell, const int istep, const int estep, const int estep_max, int &iter, bool &conv_esolver)
Finish an electronic iteration and update the saved state and requested energy-density matrix.
Definition esolver_ks_lcao_tddft.cpp:464
bool restart_done
Whether the saved restart endpoint has been replayed to rebuild the electronic state.
Definition esolver_ks_lcao_tddft.h:106
void print_step()
Print the electronic-step header using a 1-based step number.
Definition esolver_ks_lcao_tddft.cpp:356
psi::Psi< std::complex< double > > * psi_laststep
Wave functions for all local k-points of the last electronic step.
Definition esolver_ks_lcao_tddft.h:75
std::shared_ptr< elecstate::TDFieldManager > td_field_manager_
Field manager shared by propagation, potentials, and restart output.
Definition esolver_ks_lcao_tddft.h:109
void weight_dm_rho(const UnitCell &ucell)
Apply specified occupations and rebuild band energy, density matrices, and charge density.
Definition esolver_ks_lcao_tddft.cpp:678
static constexpr ct::DeviceType ct_device_type_hs
Store Hk_laststep and Sk_laststep on the CPU, including for GPU propagation.
Definition esolver_ks_lcao_tddft.h:89
Velocity_op< TR > * velocity_mat
Velocity matrix for calculating current.
Definition esolver_ks_lcao_tddft.h:95
ESolver_KS_LCAO_TDDFT()
Initialize the solver identity and basis name.
Definition esolver_ks_lcao_tddft.cpp:35
TD_info * get_td_info() const override
Return the solver-owned RT state used by LCAO operators and output.
Definition esolver_ks_lcao_tddft.h:40
void before_all_runners(BaseCell &basecell, const Input_para &inp) override
Initialize the LCAO solver, shared field state, and optional restart wave functions.
Definition esolver_ks_lcao_tddft.cpp:61
int scf_iter_limit(const int istep) const override
Use the initial-state limit for initialization or restart replay, and the RT limit for propagation.
Definition esolver_ks_lcao_tddft.cpp:127
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Write the electronic-step energy and TD observables after the SCF loop.
Definition esolver_ks_lcao_tddft.cpp:653
int restart_step_
Fixed electronic-step origin loaded at restart, independent of field advancement.
Definition esolver_ks_lcao_tddft.h:113
bool use_tensor
Control tensor-based heterogeneous computing of the TDDFT solver.
Definition esolver_ks_lcao_tddft.h:84
std::unique_ptr< module_rt::TD_MovingGauge > td_mg_
Moving-basis correction matrices, allocated when the moving spatial gauge is enabled.
Definition esolver_ks_lcao_tddft.h:103
TD_info * td_p
Solver-owned TD context for field-dependent LCAO operators and observables.
Definition esolver_ks_lcao_tddft.h:98
ct::Tensor Hk_laststep
Hamiltonian for all local k-points of the last electronic step.
Definition esolver_ks_lcao_tddft.h:78
virtual void runner(BaseCell &basecell, const int istep) override
Run the electronic steps belonging to one MD call, including initialization or restart replay.
Definition esolver_ks_lcao_tddft.cpp:134
bool use_lapack
Use gathered full matrices rather than distributed matrices in tensor propagation.
Definition esolver_ks_lcao_tddft.h:86
int totstep
Current 0-based electronic-step index, with -1 before the initial state.
Definition esolver_ks_lcao_tddft.h:92
ESolver_KS_LCAO()
Definition esolver_ks_lcao.cpp:72
bool conv_esolver
Definition esolver.h:46
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition velocity_op.h:22
A multi-dimensional array of elements of a single data type.
Definition tensor.h:32
Own and advance all time-dependent electric fields in RT-TDDFT.
Definition td_field_manager.h:36
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
@ DT_COMPLEX_DOUBLE
Definition tensor_enums.h:22
DeviceType
Definition tensor_enums.h:28
@ CpuDevice
Definition tensor_enums.h:30
Definition read_atoms_hlp_test.cpp:13