@@ -53,10 +53,8 @@ HamiltLCAO<TK, TR>::HamiltLCAO(const UnitCell& ucell,
5353{
5454 this ->classname = " HamiltLCAO" ;
5555
56- // Real space Hamiltonian is inited with template TR
57- // this->hR = new HContainer<TR>(paraV);
56+ // initialize the overlap matrix
5857 this ->sR = new HContainer<TR>(paraV);
59- // this->hsk = new HS_Matrix_K<TK>(paraV);
6058
6159 this ->getOperator () = new OverlapNew<OperatorLCAO<TK, TR>>(this ->hsk ,
6260 kv.kvec_d ,
@@ -350,7 +348,7 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
350348 }
351349 Operator<TK>* td_ekinetic = new TDEkinetic<OperatorLCAO<TK, TR>>(this ->hsk ,
352350 this ->hR ,
353- kv,
351+ & kv,
354352 &ucell,
355353 orb.cutoffs (),
356354 &grid_d,
@@ -419,6 +417,7 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
419417 this ->getOperator ()->add (exx);
420418 }
421419#endif
420+
422421 // if NSPIN==2, HR should be separated into two parts, save HR into this->hRS2
423422 int memory_fold = 1 ;
424423 if (PARAM.inp .nspin == 2 )
@@ -499,7 +498,7 @@ Operator<TK>*& HamiltLCAO<TK, TR>::getOperator()
499498template <typename TK, typename TR>
500499void HamiltLCAO<TK, TR>::updateSk(
501500 const int ik,
502- std::vector< ModuleBase::Vector3<double > >& kvec_d,
501+ const ModuleBase::Vector3<double >& kvec_d,
503502 const int hk_type)
504503{
505504 ModuleBase::TITLE (" HamiltLCAO" , " updateSk" );
@@ -510,12 +509,12 @@ void HamiltLCAO<TK, TR>::updateSk(
510509 if (hk_type == 1 ) // collumn-major matrix for SK
511510 {
512511 const int nrow = this ->hsk ->get_pv ()->get_row_size ();
513- hamilt::folding_HR (*this ->sR , this ->getSk (), kvec_d[ik] , nrow, 1 );
512+ hamilt::folding_HR (*this ->sR , this ->getSk (), kvec_d, nrow, 1 );
514513 }
515514 else if (hk_type == 0 ) // row-major matrix for SK
516515 {
517516 const int ncol = this ->hsk ->get_pv ()->get_col_size ();
518- hamilt::folding_HR (*this ->sR , this ->getSk (), kvec_d[ik] , ncol, 0 );
517+ hamilt::folding_HR (*this ->sR , this ->getSk (), kvec_d, ncol, 0 );
519518 }
520519 else
521520 {
0 commit comments