Skip to content

Commit

Permalink
Merge pull request #3 from sanshar/fix_icmpspt
Browse files Browse the repository at this point in the history
Fix for uncontracted part of icmpspt
  • Loading branch information
bogdanoff authored May 25, 2020
2 parents 153bd69 + c2fd787 commit dad1a74
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions modules/ResponseTheory/sweepResponse.C
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,17 @@ void SpinAdapted::SweepResponse::BlockAndDecimate (SweepParams &sweepParams, Sta
}
pout << "**** STACK MEMORY REMAINING before renormalization***** "<<1.0*(Stackmem[0].size-Stackmem[0].memused)*sizeof(double)/1.e9<<" GB"<<endl;

double noise_resp1 = 0;
double noise_resp2 = 0;
if (dmrginp.calc_type() != RESPONSEAAAV && dmrginp.calc_type() != RESPONSEAAAC) {
noise_resp1 = sweepParams.get_noise();
noise_resp2 = sweepParams.get_additional_noise();
}
newSystem.RenormaliseFrom (sweepParams.set_lowest_energy(), sweepParams.set_lowest_energy_spins(),
sweepParams.set_lowest_error(), rotatematrix,
sweepParams.get_keep_states(), sweepParams.get_keep_qstates(),
sweepParams.get_davidson_tol(), big, sweepParams.get_guesstype(),
sweepParams.get_noise(), sweepParams.get_additional_noise(), //noise
noise_resp1, noise_resp2, //noise
sweepParams.get_onedot(), system, systemDot, environment,
dot_with_sys, useSlater, sweepParams.get_sweep_iter(), targetState,
lowerStates, &bratracedMatrix);
Expand All @@ -279,12 +285,15 @@ void SpinAdapted::SweepResponse::BlockAndDecimate (SweepParams &sweepParams, Sta

p1out <<"\t\t\t Performing Renormalization "<<endl;

//rotatematrix.resize(0);
if (dmrginp.calc_type() == RESPONSEAAAV || dmrginp.calc_type() == RESPONSEAAAC)
rotatematrix.resize(0);
pout << "**** STACK MEMORY REMAINING before renormalization***** "<<1.0*(Stackmem[0].size-Stackmem[0].memused)*sizeof(double)/1.e9<<" GB"<<endl;

if(mpigetrank() == 0) {
//ScaleAdd(sweepParams.get_noise()*(max(1.e-5, trace(branoiseMatrix))), branoiseMatrix, bratracedMatrix);
//sweepParams.set_lowest_error() = makeRotateMatrix(bratracedMatrix, rotatematrix, sweepParams.get_keep_states(), sweepParams.get_keep_qstates());
if (dmrginp.calc_type() == RESPONSEAAAV || dmrginp.calc_type() == RESPONSEAAAC) {
ScaleAdd(sweepParams.get_noise()*(max(1.e-5, trace(branoiseMatrix))), branoiseMatrix, bratracedMatrix);
sweepParams.set_lowest_error() = makeRotateMatrix(bratracedMatrix, rotatematrix, sweepParams.get_keep_states(), sweepParams.get_keep_qstates());
}
bratracedMatrix.deallocate();
}
branoiseMatrix.deallocate();
Expand Down

0 comments on commit dad1a74

Please sign in to comment.