ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
td_moving_gauge.h
Go to the documentation of this file.
1#ifndef TD_MOVING_GAUGE_H
2#define TD_MOVING_GAUGE_H
3
8
9#include <memory>
10#include <vector>
11
12class BasisFlattenedIndexing; // Defined in source/source_base/basis_flattened_indexing.h
13class Parallel_Blkcyclic; // Defined in source/source_base/parallel_blkcyc.h
14
15namespace module_rt
16{
17
19{
20 public:
21 TD_MovingGauge() = default;
22 ~TD_MovingGauge() = default;
23
24 // Initialize the R-space derivative matrices D_R (x, y, z)
25 // using the provided sR_template for consistent sparse atomic pair topology
26 // D_{K,\mu\nu}(R) = <\phi_{\mu 0}|∂\phi_{\nu R}/∂\tau_K> where tau_K is the position of atom K
27 template <typename T_sR>
28 void init_DR(const hamilt::HContainer<T_sR>* sR_template,
29 const UnitCell* ucell,
30 const BasisFlattenedIndexing& basis,
31 const Parallel_Blkcyclic& layout,
32 TwoCenterIntegrator* intor);
33
34 // Update the R-space matrix D_R (x, y, z)
35 template <typename T_sR>
36 void update_DR(const hamilt::HContainer<T_sR>* sR_template,
37 const UnitCell* ucell,
38 const BasisFlattenedIndexing& basis,
39 const Parallel_Blkcyclic& layout,
40 TwoCenterIntegrator* intor);
41
42 // Fourier transform D(R) to D(k)
43 // Note: folding_HR performs an accumulation (+=) operation, need to ensure Dk matrices are zeroed before calling
44 // D_{K,\mu\nu}(k) = \sum_R e^{ikR} D_{K,\mu\nu}(R)
45 template <typename TK>
46 void get_D_k(int iat,
47 const ModuleBase::Vector3<double>& kvec_d,
48 TK* Dk_x,
49 TK* Dk_y,
50 TK* Dk_z,
51 int hk_ld) const;
52
53 // Calculate the moving spatial gauge matrix P_k and accumulate it to the input P_k matrix
54 // Note: The unit is converted to Rydberg atomic units, and multiplied by 2 internally
55 // P_{\mu\nu}(k) = -i \sum_K vel_K \cdot D_{K,\mu\nu}(k) where vel_K is the velocity of atom K
56 template <typename TK>
57 void get_P_k(const UnitCell* ucell,
58 const ModuleBase::Vector3<double>& kvec_d,
59 TK* P_k,
60 int matrix_size,
61 int hk_ld) const;
62
63 private:
64 template <typename T_sR>
65 void fill_DR(const hamilt::HContainer<T_sR>* sR_template,
66 const UnitCell* ucell,
67 const BasisFlattenedIndexing& basis,
68 const Parallel_Blkcyclic& layout,
69 TwoCenterIntegrator* intor);
70
71 int nat_ = 0;
72
73 std::vector<std::unique_ptr<hamilt::HContainer<double>>> dr_x_;
74 std::vector<std::unique_ptr<hamilt::HContainer<double>>> dr_y_;
75 std::vector<std::unique_ptr<hamilt::HContainer<double>>> dr_z_;
76};
77
78} // namespace module_rt
79
80#endif // TD_MOVING_GAUGE_H
Canonical atom-major flattening of the LCAO basis hierarchy.
Definition basis_flattened_indexing.h:40
3 elements vector
Definition vector3.h:21
Parallel block-cyclic matrix distribution.
Definition parallel_blkcyc.h:25
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition hcontainer.h:147
void get_P_k(const UnitCell *ucell, const ModuleBase::Vector3< double > &kvec_d, TK *P_k, int matrix_size, int hk_ld) const
Definition td_moving_gauge.cpp:211
std::vector< std::unique_ptr< hamilt::HContainer< double > > > dr_x_
Definition td_moving_gauge.h:73
std::vector< std::unique_ptr< hamilt::HContainer< double > > > dr_z_
Definition td_moving_gauge.h:75
void update_DR(const hamilt::HContainer< T_sR > *sR_template, const UnitCell *ucell, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, TwoCenterIntegrator *intor)
Definition td_moving_gauge.cpp:110
void fill_DR(const hamilt::HContainer< T_sR > *sR_template, const UnitCell *ucell, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, TwoCenterIntegrator *intor)
Definition td_moving_gauge.cpp:120
void get_D_k(int iat, const ModuleBase::Vector3< double > &kvec_d, TK *Dk_x, TK *Dk_y, TK *Dk_z, int hk_ld) const
Definition td_moving_gauge.cpp:198
void init_DR(const hamilt::HContainer< T_sR > *sR_template, const UnitCell *ucell, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, TwoCenterIntegrator *intor)
Definition td_moving_gauge.cpp:62
int nat_
Definition td_moving_gauge.h:71
std::vector< std::unique_ptr< hamilt::HContainer< double > > > dr_y_
Definition td_moving_gauge.h:74
Definition band_energy.cpp:21