@@ -724,11 +724,17 @@ def calc_ctmrg_env(
724724 else :
725725 converged = False
726726 end_count = tmp_count
727- if logger .isEnabledFor (logging .INFO ):
728- if logger .isEnabledFor (logging .WARNING ) and not converged :
729- logger .warning ("CTMRG: ❌ did not converge, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" , time .perf_counter () - t0 , end_count , norm_smallest_S )
730- else :
731- logger .info ("CTMRG: ✅ converged, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" , time .perf_counter () - t0 , end_count , norm_smallest_S )
727+
728+ if not converged and logger .isEnabledFor (logging .WARNING ):
729+ logger .warning (
730+ "CTMRG: ❌ did not converge, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" ,
731+ time .perf_counter () - t0 , end_count , norm_smallest_S
732+ )
733+ elif logger .isEnabledFor (logging .INFO ):
734+ logger .info (
735+ "CTMRG: ✅ converged, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" ,
736+ time .perf_counter () - t0 , end_count , norm_smallest_S
737+ )
732738
733739 if converged and (
734740 working_unitcell [0 , 0 ][0 ][0 ].chi > best_chi or best_result is None
@@ -762,7 +768,7 @@ def calc_ctmrg_env(
762768
763769 if logger .isEnabledFor (logging .INFO ):
764770 logger .info (
765- "Increasing chi to {} since smallest SVD Norm was {} ." ,
771+ "Increasing chi to %d since smallest SVD Norm was %.3e ." ,
766772 new_chi ,
767773 norm_smallest_S ,
768774 )
@@ -796,7 +802,7 @@ def calc_ctmrg_env(
796802
797803 if logger .isEnabledFor (logging .INFO ):
798804 logger .info (
799- "Decreasing chi to {} since smallest SVD Norm was {} or routine did not converge." ,
805+ "Decreasing chi to %d since smallest SVD Norm was %.3e or routine did not converge." ,
800806 new_chi ,
801807 norm_smallest_S ,
802808 )
@@ -820,7 +826,7 @@ def calc_ctmrg_env(
820826 ):
821827 if logger .isEnabledFor (logging .INFO ):
822828 logger .info (
823- "Increasing SVD truncation eps to {} ." ,
829+ "Increasing SVD truncation eps to %d ." ,
824830 new_truncation_eps ,
825831 )
826832 varipeps_global_state .ctmrg_effective_truncation_eps = (
@@ -1030,7 +1036,17 @@ def calc_ctmrg_env_rev(
10301036 )
10311037
10321038 varipeps_global_state .ctmrg_effective_truncation_eps = None
1033- debug_print ("Custom VJP: Converged: {}, Steps: {}" , converged , end_count )
1039+
1040+ if not converged and logger .isEnabledFor (logging .WARNING ):
1041+ logger .warning (
1042+ "Custom VJP: ❌ did not converge, took %.2f seconds. (Steps: %d)" ,
1043+ time .perf_counter () - t0 , end_count
1044+ )
1045+ elif logger .isEnabledFor (logging .INFO ):
1046+ logger .info (
1047+ "Custom VJP: ✅ converged, took %.2f seconds. (Steps: %d)" ,
1048+ time .perf_counter () - t0 , end_count
1049+ )
10341050 if end_count == varipeps_config .ad_custom_max_steps and not converged :
10351051 raise CTMRGGradientNotConvergedError
10361052
0 commit comments