24 const double lat0 = *this->lat0;
25 const size_t sizeA1 = index_A1[TA].count_size;
26 const size_t sizeA2 = index_A2[TA].count_size;
27 const size_t sizeB = index_B[TB].count_size;
36 default:
throw std::invalid_argument(std::string(__FILE__)+
" line "+std::to_string(__LINE__));
41 for(
const std::pair<
const int, std::map<
size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>>> &co3 :
center2_orb21_s.at(TA).at(TB) )
43 const int LA1 = co3.first;
44 for(
const std::pair<
const size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>> &co4 : co3.second )
46 const size_t NA1 = co4.first;
47 for (
const std::pair<
const int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>> &co5 : co4.second)
49 const int LA2 = co5.first;
50 for (
const std::pair<
const size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>> &co6 : co5.second)
52 const size_t NA2 = co6.first;
53 for (
const std::pair<
const int, std::map<size_t, Center2_Orb::Orb21>> &co7 : co6.second)
55 const int LB = co7.first;
56 for (
const std::pair<const size_t, Center2_Orb::Orb21> &co8 : co7.second)
58 const size_t NB = co8.first;
59 const std::vector<double> overlaps = co8.second.cal_overlap(position_A, position_B);
60 for (
size_t MA1 = 0; MA1 != 2 * LA1 + 1; ++MA1)
62 for (
size_t MA2 = 0; MA2 != 2 * LA2 + 1; ++MA2)
64 for(
size_t MB=0; MB!=2*LB+1; ++MB )
66 const size_t offset = (MA1 * (2 * LA2 + 1) + MA2) * (2 * LB + 1) + MB;
67 const Tdata overlap = overlaps[offset];
68 const size_t iA1 = index_A1[TA][LA1][NA1][MA1];
69 const size_t iA2 = index_A2[TA][LA2][NA2][MA2];
70 const size_t iB = index_B[TB][LB][NB][MB];
79 default:
throw std::invalid_argument(std::string(__FILE__)+
" line "+std::to_string(__LINE__));
104 std::array<RI::Tensor<Tdata>,3> m;
105 const double lat0 = *this->lat0;
106 const size_t sizeA1 = index_A1[TA].count_size;
107 const size_t sizeA2 = index_A2[TA].count_size;
108 const size_t sizeB = index_B[TB].count_size;
109 for(
int i=0; i<m.size(); ++i)
119 default:
throw std::invalid_argument(std::string(__FILE__)+
" line "+std::to_string(__LINE__));
125 for(
const std::pair<
const int, std::map<
size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>>> &co3 :
center2_orb21_s.at(TA).at(TB) )
127 const int LA1 = co3.first;
128 for(
const std::pair<
const size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>> &co4 : co3.second )
130 const size_t NA1 = co4.first;
131 for (
const std::pair<
const int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>> &co5 : co4.second)
133 const int LA2 = co5.first;
134 for (
const std::pair<
const size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>> &co6 : co5.second)
136 const size_t NA2 = co6.first;
137 for (
const std::pair<
const int, std::map<size_t, Center2_Orb::Orb21>> &co7 : co6.second)
139 const int LB = co7.first;
140 for (
const std::pair<const size_t, Center2_Orb::Orb21> &co8 : co7.second)
142 const size_t NB = co8.first;
143 const std::vector<ModuleBase::Vector3<double>> overlaps = co8.second.cal_grad_overlap(position_A, position_B);
144 for (
size_t MA1 = 0; MA1 != 2 * LA1 + 1; ++MA1)
146 for (
size_t MA2 = 0; MA2 != 2 * LA2 + 1; ++MA2)
148 for(
size_t MB=0; MB!=2*LB+1; ++MB )
150 const size_t offset = (MA1 * (2 * LA2 + 1) + MA2) * (2 * LB + 1) + MB;
151 const std::array<double, 3> grad_overlap =
153 const size_t iA1 = index_A1[TA][LA1][NA1][MA1];
154 const size_t iA2 = index_A2[TA][LA2][NA2][MA2];
155 const size_t iB = index_B[TB][LB][NB][MB];
156 for(
size_t i=0; i<m.size(); ++i)
166 default:
throw std::invalid_argument(std::string(__FILE__)+
" line "+std::to_string(__LINE__));
190 std::map<size_t,std::map<size_t,std::map<size_t,std::map<size_t,std::vector<RI::Tensor<Tdata>>>>>> matrixes;
192 for(
const std::pair<
const size_t, std::map<
size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>>>>> &co1 :
center2_orb21_s )
194 const size_t TA = co1.first;
195 for(
size_t IA=0; IA!=ucell.
atoms[TA].
na; ++IA )
199 for(
const std::pair<
const size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<
size_t, std::map<
int, std::map<size_t, Center2_Orb::Orb21>>>>>>> &co2 : co1.second )
201 const size_t TB = co2.first;
202 for(
size_t IB=0; IB!=ucell.
atoms[TB].
na; ++IB )
207 matrixes[TA][IA][TB][IB].resize(2);
208 matrixes[TA][IA][TB][IB][0] = std::move(m);
210 matrixes[TB][IB][TA][IA].resize(2);
211 matrixes[TB][IB][TA][IA][1] = std::move(n);
217 for (std::pair<
const size_t, std::map<
size_t, std::map<
size_t, std::map<
size_t, std::vector<
RI::Tensor<Tdata>>>>>> m1 : matrixes)
219 const size_t T = m1.first;
220 for( std::pair<
const size_t, std::map<
size_t, std::map<
size_t, std::vector<
RI::Tensor<Tdata>>>>> m2 : m1.second )
222 const size_t I = m2.first;
223 matrixes[
T][I][
T][I].resize(1);
std::vector< ModuleBase::Vector3< double > > tau
Cartesian coordinates of each atom in this type, in unit of lat0.
Definition atom_spec.h:52
std::map< size_t, std::map< size_t, std::map< int, std::map< size_t, std::map< int, std::map< size_t, std::map< int, std::map< size_t, Center2_Orb::Orb21 > > > > > > > > center2_orb21_s
Definition matrix_orbs21.h:87
std::array< RI::Tensor< Tdata >, 3 > cal_grad_overlap_matrix(const size_t TA, const size_t TB, const ModuleBase::Vector3< double > &tauA, const ModuleBase::Vector3< double > &tauB, const ModuleBase::Element_Basis_Index::IndexLNM &index_A1, const ModuleBase::Element_Basis_Index::IndexLNM &index_A2, const ModuleBase::Element_Basis_Index::IndexLNM &index_B, const Matrix_Order &matrix_order) const
Definition matrix_orbs21.hpp:94
std::map< size_t, std::map< size_t, std::map< size_t, std::map< size_t, std::vector< RI::Tensor< Tdata > > > > > > cal_overlap_matrix_all(const UnitCell &ucell, const ModuleBase::Element_Basis_Index::IndexLNM &index_A1, const ModuleBase::Element_Basis_Index::IndexLNM &index_A2, const ModuleBase::Element_Basis_Index::IndexLNM &index_B) const
Definition matrix_orbs21.hpp:182
RI::Tensor< Tdata > cal_overlap_matrix(const size_t TA, const size_t TB, const ModuleBase::Vector3< double > &tauA, const ModuleBase::Vector3< double > &tauB, const ModuleBase::Element_Basis_Index::IndexLNM &index_A1, const ModuleBase::Element_Basis_Index::IndexLNM &index_A2, const ModuleBase::Element_Basis_Index::IndexLNM &index_B, const Matrix_Order &matrix_order) const
Definition matrix_orbs21.hpp:13