Skip to content

Commit

Permalink
Update berryphase.cpp (#3876)
Browse files Browse the repository at this point in the history
* Update berryphase.cpp

Initialize ik_1 and ik_2 in berryphase.cpp

* Update berryphase.cpp

Initialize modulus in berryphase.cpp
  • Loading branch information
Pureorangeade committed Apr 2, 2024
1 parent 222f1f2 commit 6814360
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/module_io/berryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ double berryphase::stringPhase(int index_str,
{
std::complex<double> zeta(1.0, 0.0);
ModuleBase::ComplexMatrix mat(nbands,nbands);
int ik_1;
int ik_2;
int ik_1 = 0;
int ik_2 = 0;
ModuleBase::Vector3<double> G(0.0,0.0,0.0);
ModuleBase::Vector3<double> dk = kv.kvec_c[ k_index[index_str][1] ] - kv.kvec_c[ k_index[index_str][0] ];
//GlobalV::ofs_running << "the std::string index is " << index_str << std::endl;
Expand Down Expand Up @@ -577,7 +577,7 @@ void berryphase::Macroscopic_polarization(const int npwx,
// ion polarization end

// calculate Macroscopic polarization modulus because berry phase
int modulus;
int modulus = 0;
if( (!lodd) && (GlobalV::NSPIN==1) ) modulus = 2;
else modulus = 1;

Expand Down

0 comments on commit 6814360

Please sign in to comment.