Skip to content

Commit

Permalink
cherry-pick molcas/block_calldmrg.C from d851f74
Browse files Browse the repository at this point in the history
  • Loading branch information
naokin authored and bogdanoff committed Oct 22, 2019
1 parent a01dab6 commit 2ab79f1
Showing 1 changed file with 18 additions and 42 deletions.
60 changes: 18 additions & 42 deletions molcas/block_calldmrg.C
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void block_calldmrg (
fcon << "schedule" << endl;
while(M_start < M_state) {
fcon << setw(2) << N_sweep << setw(5) << M_start << " " << T_start << " " << T_start << endl;
N_sweep += 2;
N_sweep += 8;
M_start *= 2;
}
// while(T_start > T_sweep && T_start > 1.0e-6) {
Expand All @@ -120,59 +120,35 @@ void block_calldmrg (
// }
while(T_start >= T_sweep) {
fcon << setw(2) << N_sweep << setw(5) << M_state << " " << T_start << " " << T_start << endl;
N_sweep += 2;
N_sweep += 4;
T_start /= 10;
}
fcon << setw(2) << N_sweep << setw(5) << M_state << " " << T_sweep/10 << " 0.0" << endl;
if(Restart != 1) {
N_sweep += 8;
fcon << setw(2) << N_sweep << setw(5) << M_state << " " << T_sweep/10 << " 0.0" << endl;
}
fcon << "end" << endl;
fcon << "maxiter 100" << endl;

fcon << "sweep_tol " << T_sweep << endl;

switch (Restart) {
// No restart
case 0:
// FIXME: not sure whether this is the best choice
// in practice, i found that guess calc. often fails for high-spin state with symmetry
// if(M_s > 2 && symlab != "c1 ") {
// // use wilson guess to avoid the bug for the time
// // since this makes slower convergence, perform 4 extra sweeps w/ twodot
// N_sweep += 4;
// fcon << "warmup wilson" << endl;
// }
// else {
fcon << "warmup local_3site" << endl;
// }
break;

// Restart from onedot
case 1:
// FIXME:
// when using restart for N_roots = 1, energy oscillation occurs somehow...
// it might be a bug for restart at restoring previous state info?
// fullrestart with SA-DMRG and onedot fails
if(N_roots == 1)
fcon << "fullrestart" << endl;
else
fcon << "restart" << endl;
fcon << "reset_iter" << endl;
break;

// Full-Restart
case 2:
if(Restart == 0) {
fcon << "warmup local_3site" << endl;
}
else {
if(Restart == 1 && N_roots > 1)
fcon << "restart" << endl;
else
fcon << "fullrestart" << endl;
fcon << "reset_iter" << endl;
break;

default:
abort();
fcon << "reset_iter" << endl;
}

if(Restart != 1)
fcon << "twodot_to_onedot " << N_sweep+4 << endl;
fcon << "twodot_to_onedot " << N_sweep << endl;
else
fcon << "onedot" << endl;

fcon << "maxiter " << N_sweep+20 << endl;
fcon << "sweep_tol " << T_sweep << endl;

switch (N_pdm) {
case 1:
fcon << "onepdm" << endl;
Expand Down

0 comments on commit 2ab79f1

Please sign in to comment.