@@ -36,7 +36,6 @@ void berryphase::get_occupation_bands()
3636 ModuleBase::WARNING_QUIT (" berryphase::get_occupation_bands" ,
3737 " not enough bands for berryphase, increase band numbers." );
3838 }
39- // GlobalV::ofs_running << "the berryphase's occ_nbands is " << occ_nbands << std::endl;
4039}
4140
4241#ifdef __LCAO
@@ -214,25 +213,6 @@ void berryphase::set_kpoints(const K_Vectors& kv, const int direction)
214213
215214 nppstr = mp_z + 1 ;
216215 }
217-
218- // test by jingan
219- /*
220- GlobalV::ofs_running << "direction is " << direction << std::endl;
221- GlobalV::ofs_running << "nppstr = " << nppstr << std::endl;
222- GlobalV::ofs_running << "total std::string is " << total_string << std::endl;
223- for(int istring = 0; istring < total_string; istring++)
224- {
225- GlobalV::ofs_running << " the std::string is " << istring << std::endl;
226- for(int count = 0; count < nppstr; count++)
227- {
228- GlobalV::ofs_running << "(" << kv.kvec_c[ k_index[istring][count] ].x << ","
229- << kv.kvec_c[ k_index[istring][count] ].y << ","
230- << kv.kvec_c[ k_index[istring][count] ].z << ")" << std::endl;
231- }
232-
233- }
234- */
235- // test by jingan
236216}
237217
238218#include " ../module_base/complexmatrix.h"
@@ -251,7 +231,6 @@ double berryphase::stringPhase(const UnitCell& ucell,
251231 int ik_2 = 0 ;
252232 ModuleBase::Vector3<double > G (0.0 , 0.0 , 0.0 );
253233 ModuleBase::Vector3<double > dk = kv.kvec_c [k_index[index_str][1 ]] - kv.kvec_c [k_index[index_str][0 ]];
254- // GlobalV::ofs_running << "the std::string index is " << index_str << std::endl;
255234
256235 for (int k_start = 0 ; k_start < (nppstr - 1 ); k_start++)
257236 {
@@ -351,45 +330,11 @@ double berryphase::stringPhase(const UnitCell& ucell,
351330 {
352331 if (PARAM.inp .nspin != 4 )
353332 {
354- // std::complex<double> my_det = lcao_method.det_berryphase(ik_1,ik_2,dk,nbands);
355333 zeta = zeta * lcao_method.det_berryphase (ucell,ik_1, ik_2, dk, nbands, *(this ->paraV ), psi_in, kv);
356- // test by jingan
357- // GlobalV::ofs_running << "methon 1: det = " << my_det << std::endl;
358- // test by jingan
359334 }
360335 else
361336 {
362337 }
363-
364- // test by jingan
365- /*
366- for (int mb = 0; mb < nbands; mb++)
367- {
368-
369- for (int nb = 0; nb < nbands; nb++)
370- {
371-
372- mat(nb, mb) = lcao_method.unkdotp_LCAO(ik_1,ik_2,nb,mb,dk,kv);
373- }
374- }
375-
376- std::complex<double> det(1.0,0.0);
377- int info = 0;
378- int *ipiv = new int[nbands];
379- LapackConnector::zgetrf(nbands, nbands, mat, nbands, ipiv, &info);
380- for (int ib = 0; ib < nbands; ib++)
381- {
382- if (ipiv[ib] != (ib+1)) det = -det * mat(ib,ib);
383- else det = det * mat(ib,ib);
384- }
385-
386- zeta = zeta*det;
387-
388- GlobalV::ofs_running << "methon 2: det = " << det << std::endl;
389-
390- delete[] ipiv;
391- */
392- // test by jingan
393338 }
394339#endif
395340 }
@@ -441,9 +386,6 @@ void berryphase::Berry_Phase(const UnitCell& ucell,
441386 dtheta = atan2 (cphik[istring].imag (), cphik[istring].real ());
442387 phik[istring] = (theta0 + dtheta) / (2 * ModuleBase::PI);
443388 phik_ave = phik_ave + wistring[istring] * phik[istring];
444- // test by jingan
445- // GlobalV::ofs_running << "phik[" << istring << "] = " << phik[istring] << std::endl;
446- // test by jingan
447389 }
448390
449391 if (PARAM.inp .nspin == 1 )
@@ -466,7 +408,6 @@ void berryphase::Berry_Phase(const UnitCell& ucell,
466408 mod_elec_tot = 1 ;
467409 }
468410
469- // GlobalV::ofs_running << "Berry_Phase end " << std::endl;
470411}
471412
472413void berryphase::Macroscopic_polarization (const UnitCell& ucell,
@@ -574,20 +515,16 @@ void berryphase::Macroscopic_polarization(const UnitCell& ucell,
574515 polarization_ion[2 ] = polarization_ion[2 ] - 2.0 * round (polarization_ion[2 ] / 2.0 );
575516 }
576517
577- // delete[] mod_ion;
578- // delete[] pdl_ion_R1;
579- // delete[] pdl_ion_R2;
580- // delete[] pdl_ion_R3;
581-
582518 // ion polarization end
583519
584520 // calculate Macroscopic polarization modulus because berry phase
585521 int modulus = 0 ;
586- if ((!lodd) && (PARAM.inp .nspin == 1 )) {
587- modulus = 2 ;
588- } else {
589- modulus = 1 ;
590- }
522+ if ((!lodd) && (PARAM.inp .nspin == 1 ))
523+ {
524+ modulus = 2 ;
525+ } else {
526+ modulus = 1 ;
527+ }
591528
592529 // test by jingan
593530 // GlobalV::ofs_running << "ion polarization end" << std::endl;
@@ -736,8 +673,6 @@ void berryphase::Macroscopic_polarization(const UnitCell& ucell,
736673 }
737674 }
738675
739- // GlobalV::ofs_running << "the Macroscopic_polarization is over" << std::endl;
740-
741676 return ;
742677}
743678
0 commit comments