Skip to content

Commit b8aff48

Browse files
committed
Inform user about error when calling spiral PEPS ansatz
1 parent 9ed3663 commit b8aff48

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

varipeps/optimization/optimizer.py

+4
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ def random_noise(a):
302302
if isinstance(input_tensors, collections.abc.Sequence) and isinstance(
303303
input_tensors[0], PEPS_Unit_Cell
304304
):
305+
if len(input_tensors[0].get_unique_tensors()) != 1:
306+
raise ValueError(
307+
"You want to use spiral PEPS but you use a unit cell with more than one site. Seems wrong to me!"
308+
)
305309
working_tensors = cast(
306310
List[jnp.ndarray],
307311
[i.tensor for i in input_tensors[0].get_unique_tensors()],

0 commit comments

Comments
 (0)