@@ -723,11 +723,17 @@ def calc_ctmrg_env(
723723 else :
724724 converged = False
725725 end_count = tmp_count
726- if logger .isEnabledFor (logging .INFO ):
727- if logger .isEnabledFor (logging .WARNING ) and not converged :
728- logger .warning ("CTMRG: ❌ did not converge, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" , time .perf_counter () - t0 , end_count , norm_smallest_S )
729- else :
730- logger .info ("CTMRG: ✅ converged, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" , time .perf_counter () - t0 , end_count , norm_smallest_S )
726+
727+ if not converged and logger .isEnabledFor (logging .WARNING ):
728+ logger .warning (
729+ "CTMRG: ❌ did not converge, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" ,
730+ time .perf_counter () - t0 , end_count , norm_smallest_S
731+ )
732+ elif logger .isEnabledFor (logging .INFO ):
733+ logger .info (
734+ "CTMRG: ✅ converged, took %.2f seconds. (Steps: %d, Smallest SVD Norm: %.3e)" ,
735+ time .perf_counter () - t0 , end_count , norm_smallest_S
736+ )
731737
732738 if converged and (
733739 working_unitcell [0 , 0 ][0 ][0 ].chi > best_chi or best_result is None
@@ -761,7 +767,7 @@ def calc_ctmrg_env(
761767
762768 if logger .isEnabledFor (logging .INFO ):
763769 logger .info (
764- "Increasing chi to {} since smallest SVD Norm was {} ." ,
770+ "Increasing chi to %d since smallest SVD Norm was %.3e ." ,
765771 new_chi ,
766772 norm_smallest_S ,
767773 )
@@ -795,7 +801,7 @@ def calc_ctmrg_env(
795801
796802 if logger .isEnabledFor (logging .INFO ):
797803 logger .info (
798- "Decreasing chi to {} since smallest SVD Norm was {} or routine did not converge." ,
804+ "Decreasing chi to %d since smallest SVD Norm was %.3e or routine did not converge." ,
799805 new_chi ,
800806 norm_smallest_S ,
801807 )
@@ -819,7 +825,7 @@ def calc_ctmrg_env(
819825 ):
820826 if logger .isEnabledFor (logging .INFO ):
821827 logger .info (
822- "Increasing SVD truncation eps to {} ." ,
828+ "Increasing SVD truncation eps to %d ." ,
823829 new_truncation_eps ,
824830 )
825831 varipeps_global_state .ctmrg_effective_truncation_eps = (
@@ -1029,7 +1035,17 @@ def calc_ctmrg_env_rev(
10291035 )
10301036
10311037 varipeps_global_state .ctmrg_effective_truncation_eps = None
1032- debug_print ("Custom VJP: Converged: {}, Steps: {}" , converged , end_count )
1038+
1039+ if not converged and logger .isEnabledFor (logging .WARNING ):
1040+ logger .warning (
1041+ "Custom VJP: ❌ did not converge, took %.2f seconds. (Steps: %d)" ,
1042+ time .perf_counter () - t0 , end_count
1043+ )
1044+ elif logger .isEnabledFor (logging .INFO ):
1045+ logger .info (
1046+ "Custom VJP: ✅ converged, took %.2f seconds. (Steps: %d)" ,
1047+ time .perf_counter () - t0 , end_count
1048+ )
10331049 if end_count == varipeps_config .ad_custom_max_steps and not converged :
10341050 raise CTMRGGradientNotConvergedError
10351051
0 commit comments