ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
velocity_op.h
Go to the documentation of this file.
1#ifndef TD_VELOCITY_OP_H
2#define TD_VELOCITY_OP_H
3
4#include <array>
5#include <memory>
6#include <unordered_map>
7
14#include "source_base/vector3.h"
16
17class Parallel_Blkcyclic; // Defined in source/source_base/parallel_blkcyc.h
18
19// Cartesian velocity-operator terms for RT-TDDFT currents.
20template <typename TR>
22{
23 public:
24 Velocity_op(const UnitCell* ucell_in,
25 const Grid_Driver* GridD_in,
26 const BasisFlattenedIndexing& basis,
27 const Parallel_Blkcyclic& layout,
28 const LCAO_Orbitals& orb,
29 const TwoCenterIntegrator* intor);
30
32 {
33 return this->current_term[i].get();
34 }
35 void calculate_vcomm_r();
37
38 private:
39 const UnitCell* ucell = nullptr;
40
41 std::unique_ptr<BasisFlattenedIndexing> basis_;
42
44
46
48 std::array<std::unique_ptr<hamilt::HContainer<std::complex<double>>>, 3> current_term;
49
50 // Each view borrows TD_info's basis indexing and distribution, which are
51 // const references and therefore never reseat, so these stay valid for the
52 // whole lifetime of this object.
53 std::vector<AtomBasisView> atom_rows_;
54 std::vector<AtomBasisView> atom_cols_;
55
56 const TwoCenterIntegrator* intor_ = nullptr;
57
63 void initialize_vcomm_r(const Grid_Driver* GridD_in);
64 void initialize_grad_term(const Grid_Driver* GridD_in);
65
66 void build_atom_basis();
67
71 void cal_vcomm_r_IJR(const int& iat1,
72 const int& iat2,
73 const int& T0,
74 const std::vector<std::unordered_map<int, std::vector<double>>>& nlm1_all,
75 const std::vector<std::unordered_map<int, std::vector<double>>>& nlm2_all,
76 std::complex<double>** current_mat_p);
77 void cal_grad_IJR(const int& iat1,
78 const int& iat2,
80 std::complex<double>** current_mat_p);
81
83 std::vector<AdjacentAtomInfo> adjs_vcommr;
84 std::vector<AdjacentAtomInfo> adjs_grad;
85
89 static bool init_done;
90};
91
92
93#endif // TD_VELOCITY_OP_H
Canonical atom-major flattening of the LCAO basis hierarchy.
Definition basis_flattened_indexing.h:40
Grid_Driver class for neighbor search interface.
Definition sltk_grid_driver.h:63
Definition orb_read.h:18
3 elements vector
Definition vector3.h:21
Parallel block-cyclic matrix distribution.
Definition parallel_blkcyc.h:25
Definition pos_op_mat.h:21
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Provide the basic information about unitcell.
Definition unitcell.h:16
void cal_vcomm_r_IJR(const int &iat1, const int &iat2, const int &T0, const std::vector< std::unordered_map< int, std::vector< double > > > &nlm1_all, const std::vector< std::unordered_map< int, std::vector< double > > > &nlm2_all, std::complex< double > **current_mat_p)
calculate the HR local matrix of <I,J,R> atom pair
Definition velocity_op.cpp:370
std::vector< AtomBasisView > atom_rows_
Definition velocity_op.h:53
std::array< std::unique_ptr< hamilt::HContainer< std::complex< double > > >, 3 > current_term
Cartesian current terms. TD terms include an imaginary part, so they are complex.
Definition velocity_op.h:48
void initialize_vcomm_r(const Grid_Driver *GridD_in)
initialize HR, search the nearest neighbor atoms HContainer is used to store the non-local pseudopote...
Definition velocity_op.cpp:35
void build_atom_basis()
Definition velocity_op.cpp:184
const LCAO_Orbitals & orb_
Definition velocity_op.h:45
ModuleBase::Vector3< double > cart_At
Store the vector potential for td_ekinetic term.
Definition velocity_op.h:87
void initialize_grad_term(const Grid_Driver *GridD_in)
Definition velocity_op.cpp:118
const TwoCenterIntegrator * intor_
Definition velocity_op.h:56
const UnitCell * ucell
Definition velocity_op.h:39
Velocity_op(const UnitCell *ucell_in, const Grid_Driver *GridD_in, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, const LCAO_Orbitals &orb, const TwoCenterIntegrator *intor)
Definition velocity_op.cpp:17
const Parallel_Blkcyclic & layout_
Definition velocity_op.h:43
static bool init_done
Definition velocity_op.h:89
std::vector< AdjacentAtomInfo > adjs_vcommr
exact the nearest neighbor atoms from all adjacent atoms
Definition velocity_op.h:83
std::vector< AdjacentAtomInfo > adjs_grad
Definition velocity_op.h:84
std::vector< AtomBasisView > atom_cols_
Definition velocity_op.h:54
hamilt::HContainer< std::complex< double > > * get_current_term_pointer(const int &i) const
Definition velocity_op.h:31
static Position_op r_calculator
Definition velocity_op.h:88
std::unique_ptr< BasisFlattenedIndexing > basis_
Definition velocity_op.h:41
void cal_grad_IJR(const int &iat1, const int &iat2, const ModuleBase::Vector3< double > &dtau, std::complex< double > **current_mat_p)
Definition velocity_op.cpp:502
void calculate_vcomm_r()
Definition velocity_op.cpp:200
void calculate_grad_term()
Definition velocity_op.cpp:454
Definition hcontainer.h:147
Grid_Driver class for neighbor search interface.