Skip to content

Commit cadf89a

Browse files
shortend step message and changed some levels
1 parent b093571 commit cadf89a

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

varipeps/config.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,23 +245,26 @@ class VariPEPS_Config:
245245
slurm_restart_mode (:obj:`Slurm_Restart_Mode`):
246246
Mode of operation to restart slurm job if maximal runtime is reached.
247247
log_level_global (:obj:`LogLevel`):
248-
Global logging level.
248+
Global logging level for the 'varipeps' package logger.
249249
log_level_optimizer (:obj:`LogLevel`):
250-
Logging level for optimizer module.
250+
Logging level for 'varipeps.optimizer'.
251251
log_level_ctmrg (:obj:`LogLevel`):
252-
Logging level for CTMRG module.
252+
Logging level for 'varipeps.ctmrg'.
253253
log_level_line_search (:obj:`LogLevel`):
254-
Logging level for line search module.
254+
Logging level for 'varipeps.line_search'.
255255
log_level_expectation (:obj:`LogLevel`):
256-
Logging level for expectation value calculations.
256+
Logging level for 'varipeps.expectation'.
257257
log_to_console (:obj:`bool`):
258-
Enable logging to console.
258+
Enable standard console logging (StreamHandler).
259+
Ignored when :obj:`VariPEPS_Config.log_tqdm` is True.
259260
log_to_file (:obj:`bool`):
260261
Enable logging to file.
261262
log_file (:obj:`str`):
262-
Filename for logging to file.
263+
Filename for logging to file (used when :obj:`VariPEPS_Config.log_to_file` is True).
263264
log_tqdm (:obj:`bool`):
264-
Enable tqdm-based console logging.
265+
Enable tqdm-based console logging. If True, messages from
266+
'varipeps.optimizer' update a tqdm progress bar, while other modules
267+
log via tqdm.write. File logging settings still apply.
265268
"""
266269

267270
# AD config
@@ -359,7 +362,6 @@ class VariPEPS_Config:
359362
log_to_console: bool = True
360363
log_to_file: bool = False
361364
log_file: str = "varipeps.log"
362-
log_step_summary_every_n: int = 1
363365
log_tqdm: bool = False #: Enable tqdm-based console logging
364366

365367
def update(self, name: str, value: Any) -> NoReturn:

varipeps/ctmrg/routine.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ def calc_ctmrg_env(
766766
working_unitcell = working_unitcell.change_chi(new_chi)
767767
initial_unitcell = initial_unitcell.change_chi(new_chi)
768768

769-
if logger.isEnabledFor(logging.WARNING):
770-
logger.warning(
769+
if logger.isEnabledFor(logging.INFO):
770+
logger.info(
771771
"Increasing chi to %d since smallest SVD Norm was %.3e.",
772772
new_chi,
773773
norm_smallest_S,
@@ -800,8 +800,8 @@ def calc_ctmrg_env(
800800
if not new_chi in already_tried_chi:
801801
working_unitcell = working_unitcell.change_chi(new_chi)
802802

803-
if logger.isEnabledFor(logging.WARNING):
804-
logger.warning(
803+
if logger.isEnabledFor(logging.info):
804+
logger.info(
805805
"Decreasing chi to %d since smallest SVD Norm was %.3e or routine did not converge.",
806806
new_chi,
807807
norm_smallest_S,
@@ -824,8 +824,8 @@ def calc_ctmrg_env(
824824
new_truncation_eps
825825
<= varipeps_config.ctmrg_increase_truncation_eps_max_value
826826
):
827-
if logger.isEnabledFor(logging.WARNING):
828-
logger.warning(
827+
if logger.isEnabledFor(logging.INFO):
828+
logger.info(
829829
"Increasing SVD truncation eps to %.1e.",
830830
new_truncation_eps,
831831
)

varipeps/optimization/optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ def random_noise(a):
11621162

11631163
step_str = f"{float(linesearch_step):0.3f}" if linesearch_step is not None else "None"
11641164
logger.info(
1165-
"📉 Step %d | Energy: %.8f Δ: %.2e | Retries: %d | Conv: %.3e | Line search step: %s | Max. trunc. err.: %.1e χ: %d | Runtime: %.0f sec",
1165+
"📉 %4d | E=%.8f ΔE=%.2e | r=%d | |∇ψ|=%.2e | ls=%s | ε_tr=%.1e | χ=%d | t=%.0fs",
11661166
int(count),
11671167
float(working_value),
11681168
-float(working_value - step_energies[random_noise_retries][-2]) if len(step_energies[random_noise_retries]) > 1 else 0.0,

0 commit comments

Comments
 (0)