Skip to content

Commit

Permalink
TN.full_simplify default to check_zero="auto"
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Dec 18, 2024
1 parent 69f28e5 commit 08430d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quimb/tensor/tensor_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10361,7 +10361,7 @@ def full_simplify(
split_simplify_opts=None,
custom_methods=(),
split_method="svd",
check_zero=True,
check_zero="auto",
inplace=False,
progbar=False,
):
Expand Down Expand Up @@ -10405,6 +10405,9 @@ def full_simplify(
check_zero : bool, optional
Whether to check if tensors have zero norm and in that case do
nothing if and when equalizing norms, rather than generating a NaN.
If 'auto' this will only be turned on if other methods that
explicitly check data entries ("A", "D", "C", "S", "L") are being
used (the default).
progbar : bool, optional
Show a live progress bar of the simplification process.
inplace : bool, optional
Expand All @@ -10431,6 +10434,10 @@ def full_simplify(
if output_inds is None:
output_inds = self.outer_inds()

if check_zero == "auto":
# any method but R checks data entries anyway
check_zero == bool(set(seq) - {"R"})

tn.squeeze_(exclude=output_inds)

if cache is None:
Expand Down

0 comments on commit 08430d9

Please sign in to comment.