Skip to content

Commit

Permalink
kraus_op: fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Dec 11, 2023
1 parent f732b73 commit 3e34a25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quimb/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def kraus_op(rho, Ek, dims=None, where=None, check=False):
if norm(SEk - eye(Ek.shape[-1]), "fro") > 1e-12:
raise ValueError("Did not find ``sum(E_k.H @ Ek) == 1``.")

if (dims is None) and (where is None):
if int(dims is None) + int(where is None) == 1:
raise ValueError("If `dims` is specified so should `where`.")

if isinstance(where, numbers.Integral):
Expand Down

0 comments on commit 3e34a25

Please sign in to comment.