@@ -133,7 +133,8 @@ class calculator {
133133
134134 double old_exe = ham_.exchange ().update (electrons);
135135 double exe_diff = fabs (old_exe);
136- auto update_hf = false ;
136+ auto const exx_update_max = 5 ;
137+ auto exx_count = exx_update_max;
137138
138139 electrons.full_comm ().barrier ();
139140 auto iter_start_time = std::chrono::high_resolution_clock::now ();
@@ -153,11 +154,13 @@ class calculator {
153154 }
154155 electrons.update_occupations (electrons.eigenvalues ());
155156 }
156-
157- if (update_hf){
157+
158+ exx_count--;
159+ if (exx_count < 1 ){
158160 auto exe = ham_.exchange ().update (electrons);
159161 exe_diff = fabs (exe - old_exe);
160162 old_exe = exe;
163+ exx_count = exx_update_max;
161164 }
162165
163166 for (auto & phi : electrons.kpin ()) {
@@ -211,8 +214,11 @@ class calculator {
211214 auto ev_out = eigenvalues_output (electrons, normres);
212215
213216 if (solver_.verbose_output () and console){
214- console->info (" \n SCF iter {} : wtime = {:5.2f}s e = {:.10f} de = {:5.0e} dexe = {:5.0e} dn = {:5.0e} dst = {:5.0e}\n {}" ,
215- iiter, elapsed_seconds.count (), res.energy .total (), energy_diff, exe_diff, density_diff, state_conv, ev_out);
217+ std::string desc = " \n SCF iter {iter} : wtime = {wtime:5.1f}s e = {energy:.10f} de = {de: 5.0e} dn = {dn:5.0e} dst = {dst:5.0e}" ;
218+ if (ham_.exchange ().enabled ()) desc += " dexx = {dexx:5.0e}" ;
219+ desc += " \n {ev_out}" ;
220+ console->info (desc, fmt::arg (" iter" , iiter), fmt::arg (" wtime" , elapsed_seconds.count ()), fmt::arg (" energy" , res.energy .total ()), fmt::arg (" de" , energy_diff),
221+ fmt::arg (" dn" , density_diff), fmt::arg (" dst" , state_conv), fmt::arg (" dexx" , exe_diff), fmt::arg (" ev_out" , ev_out));
216222 }
217223
218224 if (fabs (energy_diff) < solver_.energy_tolerance ()){
@@ -222,7 +228,7 @@ class calculator {
222228 converged = true ;
223229 break ;
224230 }
225- if (conv_count > 2 ) update_hf = true ;
231+ if (conv_count > 2 ) exx_count = 0 ;
226232 } else {
227233 conv_count = 0 ;
228234 }
0 commit comments