Skip to content

Commit

Permalink
Merge pull request #1524 from mmorale3/develop
Browse files Browse the repository at this point in the history
Fix bug in kpoint AFQMC code
  • Loading branch information
prckent authored Mar 30, 2019
2 parents d63e558 + 9be945b commit e5304ba
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/AFQMC/Hamiltonians/KPFactorizedHamiltonian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,15 +1245,13 @@ HamiltonianOperations KPFactorizedHamiltonian::getHamiltonianOperations_batched(
{nmo_max,nmo_max*nchol_max});
using ma::H;
#if MIXED_PRECISION
boost::multi::array<SPComplexType,2> v1_({nmo_per_kp[K],nmo_per_kp[K]});
boost::multi::array<SPComplexType,2> v1_({nmo_max,nmo_max});
ma::product(SPComplexType(-0.5),Likn,H(Likn),SPComplexType(1.0),v1_);
using std::copy_n;
boost::multi::array<ComplexType,2> v2_(v1_);
ma::add(ComplexType(1.0),v2_,
ComplexType(1.0),vn0_[K]({0,nmo_per_kp[K]},{0,nmo_per_kp[K]}),
vn0_[K]({0,nmo_per_kp[K]},{0,nmo_per_kp[K]}));
ma::add(ComplexType(1.0),v2_,ComplexType(1.0),vn0_[K],vn0_[K]);
#else
ma::product(-0.5,Likn,H(Likn),1.0,vn0_[K]({0,nmo_per_kp[K]},{0,nmo_per_kp[K]}));
ma::product(-0.5,Likn,H(Likn),1.0,vn0_[K]);
#endif
} else {
int QmK = QKtok2[Qm][K];
Expand All @@ -1269,13 +1267,11 @@ HamiltonianOperations KPFactorizedHamiltonian::getHamiltonianOperations_batched(
{nmo_max,nmo_max*nchol_max});
using ma::H;
#if MIXED_PRECISION
boost::multi::array<SPComplexType,2> v1_({nmo_per_kp[K],nmo_per_kp[K]});
boost::multi::array<SPComplexType,2> v1_({nmo_max,nmo_max});
ma::product(SPComplexType(-0.5),L_,H(L_),
SPComplexType(1.0),v1_);
boost::multi::array<ComplexType,2> v2_(v1_);
ma::add(ComplexType(1.0),v2_,
ComplexType(1.0),vn0_[K]({0,nmo_per_kp[K]},{0,nmo_per_kp[K]}),
vn0_[K]({0,nmo_per_kp[K]},{0,nmo_per_kp[K]}));
ma::add(ComplexType(1.0),v2_,ComplexType(1.0),vn0_[K],vn0_[K]);
#else
ma::product(-0.5,L_,H(L_),1.0,vn0_[K]);
#endif
Expand Down

0 comments on commit e5304ba

Please sign in to comment.