@@ -200,6 +200,8 @@ def line_search(
200
200
201
201
count = 0
202
202
while count < peps_ad_config .line_search_max_steps :
203
+ print (f"Try line search step size { alpha } " )
204
+
203
205
new_tensors = _line_search_new_tensors (input_tensors , descent_direction , alpha )
204
206
205
207
if convert_to_unitcell_func is None :
@@ -256,11 +258,6 @@ def line_search(
256
258
)
257
259
new_gradient = [elem .conj () for elem in new_gradient_seq ]
258
260
except (CTMRGNotConvergedError , CTMRGGradientNotConvergedError ):
259
- # import datetime
260
-
261
- # new_unitcell.save_to_file(
262
- # f"/home/janluca/Promotion/peps/peps-ad/data/broken/{datetime.datetime.now().isoformat()}.hdf5"
263
- # )
264
261
new_value = jnp .inf
265
262
new_gradient = gradient
266
263
else :
@@ -399,28 +396,6 @@ def line_search(
399
396
)
400
397
wolfe_alpha_last_step = tmp_alpha
401
398
402
- # if wolfe_cond_1 and wolfe_cond_2:
403
- # break
404
- # elif not wolfe_cond_1 and wolfe_cond_2:
405
- # wolfe_upper_bound = alpha
406
- # new_alpha = peps_ad_config.line_search_reduction_factor * alpha
407
- # exp = 1
408
- # while new_alpha <= wolfe_lower_bound:
409
- # new_alpha = (1 - 0.5**exp * (1 - peps_ad_config.line_search_reduction_factor)) * alpha
410
- # exp += 1
411
- # alpha = new_alpha
412
- # elif wolfe_cond_1 and not wolfe_cond_2:
413
- # wolfe_lower_bound = alpha
414
- # new_alpha = alpha / peps_ad_config.line_search_reduction_factor
415
- # exp = 1
416
- # while new_alpha >= wolfe_upper_bound:
417
- # new_alpha = alpha / (1 - 0.5**exp * (1 - peps_ad_config.line_search_reduction_factor))
418
- # exp += 1
419
- # alpha = new_alpha
420
- # else:
421
- # raise NoSuitableStepSizeError(f"Wolfe search failed: Alpha {alpha}, Lower bound: {wolfe_lower_bound}, Upper bound {wolfe_upper_bound}")
422
-
423
- print (alpha )
424
399
count += 1
425
400
426
401
if count == peps_ad_config .line_search_max_steps :
0 commit comments