@@ -222,7 +222,7 @@ void DFTU::init(
222222 this ->J_Yukawa .resize (cell.ntype );
223223
224224 for (int it=0 ; it<cell.ntype ; it++)
225- {
225+ {
226226 const int NL = cell.atoms [it].nwl + 1 ;
227227
228228 this ->Fk .at (it).resize (NL);
@@ -246,7 +246,7 @@ void DFTU::init(
246246 // {
247247 // this->cal_slater_Fk(l, it);
248248 // this->cal_slater_UJ(it, l);
249- // }
249+ // }
250250 }
251251 }
252252 }
@@ -1437,66 +1437,60 @@ void DFTU::output()
14371437
14381438void DFTU::cal_eff_pot_mat_R_double (const int ispin, double * SR, double * HR)
14391439{
1440- const char transN = ' N' , transT = ' T' ;
1441- const int one_int = 1 ;
1442- const double alpha = 1.0 , beta = 0.0 , one=1.0 , half=0.5 ;
1443-
1444- for (int i=0 ; i<GlobalC::ParaO.nloc ; i++) HR[i] = 0.0 ;
1440+ const char transN = ' N' , transT = ' T' ;
1441+ const int one_int = 1 ;
1442+ const double alpha = 1.0 , beta = 0.0 , one=1.0 , half=0.5 ;
14451443
14461444 std::vector<double > VU (GlobalC::ParaO.nloc );
14471445 this ->cal_VU_pot_mat_real (ispin, 1 , &VU[0 ]);
14481446
1449- pdgemm_ (&transN, &transN,
1450- &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1451- &half,
1452- ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1453- SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1454- &beta,
1455- HR, &one_int, &one_int, GlobalC::ParaO.desc );
1456-
1457- for (int irc=0 ; irc<GlobalC::ParaO.nloc ; irc++)
1458- VU[irc] = HR[irc];
1459-
1460- pdtran_ (&GlobalV::NLOCAL, &GlobalV::NLOCAL,
1461- &one,
1462- &VU[0 ], &one_int, &one_int, GlobalC::ParaO.desc ,
1463- &one,
1464- HR, &one_int, &one_int, GlobalC::ParaO.desc );
1447+ pdgemm_ (&transN, &transN,
1448+ &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1449+ &half,
1450+ ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1451+ SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1452+ &beta,
1453+ HR, &one_int, &one_int, GlobalC::ParaO.desc );
1454+
1455+ pdgemm_ (&transN, &transN,
1456+ &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1457+ &half,
1458+ SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1459+ ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1460+ &one,
1461+ HR, &one_int, &one_int, GlobalC::ParaO.desc );
14651462
14661463 return ;
14671464}
14681465
14691466void DFTU::cal_eff_pot_mat_R_complex_double (
14701467 const int ispin, std::complex <double >* SR, std::complex <double >* HR)
14711468{
1472- const char transN = ' N' , transT = ' T' ;
1473- const int one_int = 1 ;
1474- const std::complex <double > alpha (1.0 ,0.0 ), beta (0.0 ,0.0 );
1475- const std::complex <double > zero (0.0 ,0.0 ), half (0.5 ,0.0 ), one (1.0 ,0.0 );
1476-
1477- for (int i=0 ; i<GlobalC::ParaO.nloc ; i++) HR[i] = zero;
1469+ const char transN = ' N' , transT = ' T' ;
1470+ const int one_int = 1 ;
1471+ const std::complex <double > alpha (1.0 ,0.0 ), beta (0.0 ,0.0 );
1472+ const std::complex <double > zero (0.0 ,0.0 ), half (0.5 ,0.0 ), one (1.0 ,0.0 );
1473+
1474+ std::vector<std::complex <double >> VU (GlobalC::ParaO.nloc );
1475+ this ->cal_VU_pot_mat_complex (ispin, 1 , &VU[0 ]);
1476+
1477+ pzgemm_ (&transN, &transN,
1478+ &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1479+ &half,
1480+ ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1481+ SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1482+ &beta,
1483+ HR, &one_int, &one_int, GlobalC::ParaO.desc );
1484+
1485+ pzgemm_ (&transN, &transN,
1486+ &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1487+ &half,
1488+ SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1489+ ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1490+ &one,
1491+ HR, &one_int, &one_int, GlobalC::ParaO.desc );
14781492
1479- std::vector<std::complex <double >> VU (GlobalC::ParaO.nloc );
1480- this ->cal_VU_pot_mat_complex (ispin, 1 , &VU[0 ]);
1481-
1482- pzgemm_ (&transN, &transN,
1483- &GlobalV::NLOCAL, &GlobalV::NLOCAL, &GlobalV::NLOCAL,
1484- &half,
1485- ModuleBase::GlobalFunc::VECTOR_TO_PTR (VU), &one_int, &one_int, GlobalC::ParaO.desc ,
1486- SR, &one_int, &one_int, GlobalC::ParaO.desc ,
1487- &beta,
1488- HR, &one_int, &one_int, GlobalC::ParaO.desc );
1489-
1490- for (int irc=0 ; irc<GlobalC::ParaO.nloc ; irc++)
1491- VU[irc] = HR[irc];
1492-
1493- pztranc_ (&GlobalV::NLOCAL, &GlobalV::NLOCAL,
1494- &one,
1495- &VU[0 ], &one_int, &one_int, GlobalC::ParaO.desc ,
1496- &one,
1497- HR, &one_int, &one_int, GlobalC::ParaO.desc );
1498-
1499- return ;
1493+ return ;
15001494}
15011495
15021496void DFTU::folding_overlap_matrix (const int ik, std::complex <double >* Sk)
0 commit comments