File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,9 @@ class PEPS_AD_Config:
137137 Maximal retries for optimization with random noise.
138138 optimizer_random_noise_relative_amplitude (:obj:`float`):
139139 Relative amplitude used for random noise.
140+ optimizer_reuse_env_eps (:obj:`float`):
141+ Reuse CTMRG environment of previous step if norm of gradient is below
142+ this threshold.
140143 line_search_method (:obj:`Line_Search_Methods`):
141144 Method used for the line search routine.
142145 line_search_initial_step_size (:obj:`float`):
@@ -208,6 +211,7 @@ class PEPS_AD_Config:
208211 optimizer_random_noise_eps : float = 1e-4
209212 optimizer_random_noise_max_retries : int = 5
210213 optimizer_random_noise_relative_amplitude : float = 1e-1
214+ optimizer_reuse_env_eps : float = 1e-3
211215
212216 # Line search
213217 line_search_method : Line_Search_Methods = Line_Search_Methods .WOLFE
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ def line_search(
147147 generate_unitcell : bool = False ,
148148 spiral_indices : Optional [Sequence [int ]] = None ,
149149 additional_input : Dict [str , jnp .ndarray ] = {},
150+ reinitialize_env_as_identities : bool = True ,
150151) -> Tuple [
151152 List [jnp .ndarray ],
152153 PEPS_Unit_Cell ,
@@ -243,7 +244,8 @@ def line_search(
243244 new_unitcell = unitcell .replace_unique_tensors (
244245 [
245246 unitcell_tensors [i ].replace_tensor (
246- new_tensors [i ], reinitialize_env_as_identities = True
247+ new_tensors [i ],
248+ reinitialize_env_as_identities = reinitialize_env_as_identities ,
247249 )
248250 for i in range (unitcell .get_len_unique_tensors ())
249251 ]
Original file line number Diff line number Diff line change @@ -435,6 +435,7 @@ def random_noise(a):
435435 generate_unitcell ,
436436 spiral_indices ,
437437 additional_input ,
438+ conv > peps_ad_config .optimizer_reuse_env_eps ,
438439 )
439440 except NoSuitableStepSizeError :
440441 if peps_ad_config .optimizer_fail_if_no_step_size_found :
You can’t perform that action at this time.
0 commit comments