Skip to content

Commit 2979b09

Browse files
committed
Catch case where new_unitcell is None
1 parent b67cbbf commit 2979b09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

varipeps/optimization/line_search.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,10 @@ def line_search(
11161116

11171117
count += 1
11181118

1119-
if new_unitcell[0, 0][0][0].chi != unitcell[0, 0][0][0].chi:
1119+
if (
1120+
new_unitcell is not None
1121+
and new_unitcell[0, 0][0][0].chi != unitcell[0, 0][0][0].chi
1122+
):
11201123
jax.clear_caches()
11211124

11221125
if count == varipeps_config.line_search_max_steps:

0 commit comments

Comments
 (0)