Skip to content

Commit

Permalink
auto-formatting [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Nov 6, 2023
1 parent c29aeea commit c8ea241
Show file tree
Hide file tree
Showing 39 changed files with 2,472 additions and 1,820 deletions.
1 change: 1 addition & 0 deletions quimb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# use setuptools_scm to get the current version from src using git
from setuptools_scm import get_version as _gv
from pathlib import Path as _Path

__version__ = _gv(_Path(__file__).parent.parent)
except ImportError:
# setuptools_scm is not available, use a default version
Expand Down
7 changes: 2 additions & 5 deletions quimb/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1319,8 +1319,7 @@ def ent_cross_matrix(
rhoa = ptr(p, dims, [i + b for b in range(sz_blc)])
psiap = purify(rhoa)
ent = (
ent_fn(psiap, dims=(2**sz_blc, 2**sz_blc))
/ sz_blc
ent_fn(psiap, dims=(2**sz_blc, 2**sz_blc)) / sz_blc
)
else:
ent = np.nan
Expand All @@ -1331,9 +1330,7 @@ def ent_cross_matrix(
[i + b for b in range(sz_blc)]
+ [j + b for b in range(sz_blc)],
)
ent = (
ent_fn(rhoab, dims=(2**sz_blc, 2**sz_blc)) / sz_blc
)
ent = ent_fn(rhoab, dims=(2**sz_blc, 2**sz_blc)) / sz_blc
ents[i // sz_blc, j // sz_blc] = ent
ents[j // sz_blc, i // sz_blc] = ent

Expand Down
5 changes: 1 addition & 4 deletions quimb/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ def isreal(qob, **allclose_opts):


def allclose_sparse(A, B, **allclose_opts):

if A.shape != B.shape:
return False

Expand Down Expand Up @@ -1320,7 +1319,7 @@ def kron(*ops, stype=None, coo_build=False, parallel=False, ownership=None):
dims = [op.shape[0] for op in ops]

D = prod(dims)
if not ((0 <= ri < D) and ((0 < rf <= D))):
if not ((0 <= ri < D) and (0 < rf <= D)):
raise ValueError(f"Ownership ({ri}, {rf}) not in range [0-{D}].")

matching_dyn = tuple(gen_matching_dynal(ri, rf - 1, dims))
Expand Down Expand Up @@ -1726,10 +1725,8 @@ def gen_ops():
cff_id = 1 # keeps track of compressing adjacent identities
cff_ov = 1 # keeps track of overlaying op on multiple dimensions
for ind, dim in enumerate(dims):

# check if op should be placed here
if ind in inds:

# check if need preceding identities
if cff_id > 1:
yield eye(cff_id, **eye_kws)
Expand Down
Loading

0 comments on commit c8ea241

Please sign in to comment.