Skip to content

Commit bb3f2be

Browse files
committed
Fix logic for gradient with non-PEPS tensor elements for preconditioning
1 parent 3c44f93 commit bb3f2be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

varipeps/optimization/optimizer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def apply_precond(x):
193193
apply_contraction_jitted(contraction, (te.tensor,), (te,), (xe,))
194194
+ norm_grad_square * xe
195195
for te, xe in zip(t_objs, x[: len(t_objs)], strict=True)
196-
]
196+
] + list(x[len(t_objs) :])
197197

198198
return _make_1d(x)
199199

@@ -868,7 +868,9 @@ def random_noise(a):
868868
],
869869
strict=True,
870870
)
871-
]
871+
] + list(
872+
descent_dir[working_unitcell.get_len_unique_tensors() :]
873+
)
872874
if all(
873875
jnp.sum(xe * x2e.conj()) >= 0
874876
for xe, x2e in zip(

0 commit comments

Comments
 (0)