Skip to content

Commit f837723

Browse files
committed
delete some space
1 parent 229f14b commit f837723

File tree

9 files changed

+82
-82
lines changed

9 files changed

+82
-82
lines changed

source/module_ri/ABFs_Construct-PCA.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ namespace PCA
3232
dsyev_(&jobz, &uplo, &nr, a.ptr(), &nc, w, work.data(), &lwork, &info);
3333
}
3434

35-
RI::Tensor<double> get_sub_matrix(
35+
RI::Tensor<double> get_sub_matrix(
3636
const RI::Tensor<double> & m, // size: (lcaos, lcaos, abfs)
3737
const std::size_t & T,
3838
const std::size_t & L,
3939
const ModuleBase::Element_Basis_Index::Range & range,
4040
const ModuleBase::Element_Basis_Index::IndexLNM & index )
4141
{
42-
ModuleBase::TITLE("ABFs_Construct::PCA::get_sub_matrix");
42+
ModuleBase::TITLE("ABFs_Construct::PCA::get_sub_matrix");
4343
assert(m.shape.size() == 3);
4444
RI::Tensor<double> m_sub({ m.shape[0], m.shape[1], range[T][L].N });
4545
for (std::size_t ir=0; ir!=m.shape[0]; ++ir) {
@@ -74,12 +74,12 @@ namespace PCA
7474
std::vector<std::vector<std::pair<std::vector<double>, RI::Tensor<double>>>> cal_PCA(
7575
const UnitCell &ucell,
7676
const LCAO_Orbitals& orb,
77-
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos,
77+
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos,
7878
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs,
7979
const double kmesh_times )
8080
{
8181
ModuleBase::TITLE("ABFs_Construct::PCA::cal_PCA");
82-
82+
8383
const ModuleBase::Element_Basis_Index::Range
8484
range_lcaos = Exx_Abfs::Abfs_Index::construct_range( lcaos );
8585
const ModuleBase::Element_Basis_Index::IndexLNM
@@ -107,27 +107,27 @@ namespace PCA
107107
m_abfslcaos_lcaos.init_radial_table(delta_R);
108108

109109
GlobalC::exx_info.info_ri.abfs_Lmax = Lmax_bak;
110-
110+
111111
std::vector<std::vector<std::pair<std::vector<double>,RI::Tensor<double>>>> eig(abfs.size());
112112
for( std::size_t T=0; T!=abfs.size(); ++T )
113113
{
114-
const RI::Tensor<double> A = m_abfslcaos_lcaos.cal_overlap_matrix<double>(
115-
T,
116-
T,
114+
const RI::Tensor<double> A = m_abfslcaos_lcaos.cal_overlap_matrix<double>(
115+
T,
116+
T,
117+
ModuleBase::Vector3<double>{0,0,0},
117118
ModuleBase::Vector3<double>{0,0,0},
118-
ModuleBase::Vector3<double>{0,0,0},
119-
index_abfs,
119+
index_abfs,
120120
index_lcaos,
121121
index_lcaos,
122122
Matrix_Orbs21::Matrix_Order::A2BA1);
123-
123+
124124
eig[T].resize(abfs[T].size());
125125
for( std::size_t L=0; L!=abfs[T].size(); ++L )
126126
{
127127
const RI::Tensor<double> A_sub = get_sub_matrix( A, T, L, range_abfs, index_abfs );
128128
RI::Tensor<double> mm = A_sub.transpose() * A_sub;
129129
std::vector<double> eig_value(mm.shape[0]);
130-
130+
131131
int info=1;
132132

133133
tensor_dsyev('V', 'L', mm, eig_value.data(), info);
@@ -158,7 +158,7 @@ namespace PCA
158158
eig[T][L] = std::make_pair( eig_value, mm );
159159
}
160160
}
161-
161+
162162
return eig;
163163
}
164164

source/module_ri/exx_abfs-abfs_index.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ ModuleBase::Element_Basis_Index::Range
2929
range[T].resize( orb[T].size() );
3030
for( size_t L=0; L!=range[T].size(); ++L )
3131
{
32-
range[T][L].N = orb[T][L].size();
33-
range[T][L].M = 2*L+1;
34-
}
32+
range[T][L].N = orb[T][L].size();
33+
range[T][L].M = 2*L+1;
34+
}
3535
}
3636
return range;
3737
}

source/module_ri/exx_abfs-abfs_index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LCAO_Orbitals;
1212
class Exx_Abfs::Abfs_Index
1313
{
1414
public:
15-
static ModuleBase::Element_Basis_Index::Range construct_range( const LCAO_Orbitals &orb );
15+
static ModuleBase::Element_Basis_Index::Range construct_range( const LCAO_Orbitals &orb );
1616
static ModuleBase::Element_Basis_Index::Range construct_range( const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orb );
1717
};
1818

source/module_ri/exx_abfs-construct_orbs.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
1212
class Exx_Abfs::Construct_Orbs
1313
{
1414
public:
15-
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> change_orbs(
15+
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> change_orbs(
1616
const LCAO_Orbitals &orb_in,
1717
const double kmesh_times );
18-
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> change_orbs(
18+
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> change_orbs(
1919
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orb_in,
2020
const double kmesh_times );
2121

22-
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs_same_atom(
22+
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs_same_atom(
2323
const UnitCell &ucell,
2424
const LCAO_Orbitals& orb,
2525
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos,
2626
const double kmesh_times_mot,
2727
const double times_threshold=0);
28-
28+
2929
static void print_orbs_size(
3030
const UnitCell& ucell,
3131
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orbs,
32-
std::ostream &os);
33-
32+
std::ostream &os);
33+
3434
private:
35-
static std::vector<std::vector<std::vector<std::vector<double>>>> psi_mult_psi(
35+
static std::vector<std::vector<std::vector<std::vector<double>>>> psi_mult_psi(
3636
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos );
37-
38-
static std::vector<std::vector<std::vector<std::vector<double>>>> psir_mult_psir(
37+
38+
static std::vector<std::vector<std::vector<std::vector<double>>>> psir_mult_psir(
3939
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos );
40-
41-
static std::vector<std::vector<std::vector<std::vector<double>>>> orth(
40+
41+
static std::vector<std::vector<std::vector<std::vector<double>>>> orth(
4242
const std::vector<std::vector<std::vector<std::vector<double>>>> &psis,
4343
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &lcaos,
4444
const double norm_threshold = std::numeric_limits<double>::min() );
@@ -50,16 +50,16 @@ class Exx_Abfs::Construct_Orbs
5050
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orbs,
5151
const double kmesh_times_mot,
5252
const double times_threshold );
53-
54-
static std::vector<std::vector<std::vector<std::vector<double>>>> div_r(
53+
54+
static std::vector<std::vector<std::vector<std::vector<double>>>> div_r(
5555
const std::vector<std::vector<std::vector<std::vector<double>>>> &psirs,
56-
const std::vector<double> &r_radial );
57-
56+
const std::vector<double> &r_radial );
57+
5858
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> orbital(
5959
const std::vector<std::vector<std::vector<std::vector<double>>>> &psis,
6060
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orbs_info,
61-
const double kmesh_times);
62-
61+
const double kmesh_times);
62+
6363
static std::vector<std::vector<std::vector<std::vector<double>>>> get_psi(
6464
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &orbs );
6565
};

source/module_ri/exx_abfs-io.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::constr
1818
{
1919
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs( files_abfs.size() );
2020
for( size_t T=0; T!=files_abfs.size(); ++T )
21-
abfs[T] = construct_abfs_T(
21+
abfs[T] = construct_abfs_T(
2222
files_abfs[T],
2323
T,
2424
static_cast<int>(orbs.get_kmesh() * kmesh_times) | 1, // Nk must be odd
2525
// orbs.get_dk() / kmesh_times,
2626
orbs.get_dk(), // Peize Lin change 2017-04-16
27-
orbs.get_dr_uniform() );
28-
27+
orbs.get_dr_uniform() );
28+
2929
return abfs;
3030
}
3131

32-
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::construct_abfs(
32+
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::construct_abfs(
3333
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> & abfs_pre,
3434
const LCAO_Orbitals &orbs,
3535
const std::vector<std::string> &files_abfs,
3636
const double kmesh_times )
3737
{
38-
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
38+
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
3939
&&abfs = construct_abfs( orbs, files_abfs, kmesh_times );
40-
40+
4141
assert( abfs.size() == abfs_pre.size() );
4242
for( size_t T=0; T!=abfs.size(); ++T )
4343
{
@@ -47,12 +47,12 @@ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::constr
4747
{
4848
abfs[T][L].insert( abfs[T][L].begin(), abfs_pre[T][L].begin(), abfs_pre[T][L].end() );
4949
}
50-
}
51-
50+
}
51+
5252
return abfs;
5353
}
5454

55-
std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
55+
std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
5656
const std::string & file_name,
5757
const int &T,
5858
const int &nk,
@@ -65,28 +65,28 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
6565
size_t meshr;
6666
double dr;
6767
std::map<size_t,std::map<size_t,std::vector<double>>> psis;
68-
68+
6969
/*----------------------
7070
1.read abfs
7171
----------------------*/
7272
std::string word;
73-
73+
7474
std::ifstream ifs( file_name.c_str() );
7575
if(!ifs)
76-
throw std::runtime_error(" Can't find the abfs ORBITAL file.");
77-
76+
throw std::runtime_error(" Can't find the abfs ORBITAL file.");
77+
7878
while( ifs.good() )
7979
{
8080
ifs >> word;
81-
81+
8282
if( "Element"==word )
8383
{
8484
ModuleBase::GlobalFunc::READ_VALUE( ifs, label );
8585
}
8686
else if ( "Lmax"==word )
8787
{
8888
ModuleBase::GlobalFunc::READ_VALUE( ifs, L_size );
89-
89+
9090
if( L_size>=9 )
9191
{
9292
std::stringstream ss;
@@ -133,12 +133,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
133133
else if ( "END"==word )
134134
{
135135
break;
136-
}
136+
}
137137
}
138-
138+
139139
ModuleBase::CHECK_NAME(ifs, "Mesh");
140140
ifs >> meshr;
141-
141+
142142
ModuleBase::CHECK_NAME(ifs, "dr");
143143
ifs >> dr;
144144

@@ -149,21 +149,21 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
149149
{
150150
std::string s_L, s_N;
151151
ifs >> s_L >> s_N;
152-
152+
153153
size_t T,L,N;
154154
ifs >> T >> L >> N;
155-
155+
156156
psis[L][N].resize(meshr);
157157
for(int ir=0; ir!=meshr; ir++)
158158
{
159159
ifs >> psis[L][N][ir];
160-
}
160+
}
161161
}
162162

163163
}
164164
ifs.close();
165165

166-
166+
167167
/*----------------------
168168
2.check L,N orbital
169169
----------------------*/
@@ -183,12 +183,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
183183
throw std::domain_error(ss.str());
184184
}
185185

186-
186+
187187
/*----------------------
188188
3.rab, radial
189-
----------------------*/
189+
----------------------*/
190190
if(meshr%2==0) ++meshr;
191-
191+
192192
std::vector<double> rab(meshr);
193193
std::vector<double> radial(meshr);
194194
for( int ir=0; ir!=meshr; ++ir )
@@ -197,12 +197,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
197197
radial[ir] = ir*dr; //mohan 2010-04-19
198198
}
199199

200-
200+
201201
/*----------------------
202202
4.normalize psi
203203
----------------------*/
204204
for( size_t L=0; L<=L_size; ++L )
205-
{
205+
{
206206
for( size_t N=0; N!=N_size[L]; ++N )
207207
{
208208
std::vector<double> psir(meshr);
@@ -213,7 +213,7 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
213213
psir[ir] = psis[L][N][ir] * radial[ir];
214214
inner[ir] = psir[ir] * psir[ir];
215215
}
216-
double unit = 0.0;
216+
double unit = 0.0;
217217
ModuleBase::Integral::Simpson_Integral(meshr, ModuleBase::GlobalFunc::VECTOR_TO_PTR(inner), ModuleBase::GlobalFunc::VECTOR_TO_PTR(rab), unit);
218218
for( int ir=0; ir!=meshr; ++ir )
219219
{
@@ -222,10 +222,10 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
222222
}
223223
}
224224

225-
225+
226226
/*----------------------
227227
5.construct abfs
228-
----------------------*/
228+
----------------------*/
229229
std::vector<std::vector<Numerical_Orbital_Lm>> abfs_T;
230230

231231
abfs_T.resize(L_size+1);
@@ -248,9 +248,9 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
248248
dk,
249249
dr_uniform,
250250
false,
251-
true, PARAM.inp.cal_force);
251+
true, PARAM.inp.cal_force);
252252
}
253253
}
254-
254+
255255
return abfs_T;
256256
}

source/module_ri/exx_abfs-io.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ class LCAO_Orbitals;
1818
class Exx_Abfs::IO
1919
{
2020
public:
21-
22-
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> construct_abfs(
21+
22+
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> construct_abfs(
2323
const LCAO_Orbitals &orbs,
2424
const std::vector<std::string> &files_abfs,
25-
const double kmesh_times=1 ); // close dK, keep Kcut
26-
27-
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> construct_abfs(
28-
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_pre,
25+
const double kmesh_times=1 ); // close dK, keep Kcut
26+
27+
static std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> construct_abfs(
28+
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_pre,
2929
const LCAO_Orbitals &orbs,
3030
const std::vector<std::string> &files_abfs,
3131
const double kmesh_times=1 ); // close dK, keep Kcut

0 commit comments

Comments
 (0)