From 3e34a2540074097d61c061c5beea8def7b58338d Mon Sep 17 00:00:00 2001 From: Johnnie Gray Date: Mon, 11 Dec 2023 14:31:10 -0800 Subject: [PATCH] kraus_op: fix check --- quimb/calc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quimb/calc.py b/quimb/calc.py index b08b907d..165300b8 100644 --- a/quimb/calc.py +++ b/quimb/calc.py @@ -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):