Skip to content

Commit 589763e

Browse files
committed
fix black
1 parent 0660abf commit 589763e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tensorcircuit/templates/lattice.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,15 +1485,21 @@ def _build_neighbors_kdtree(self, max_k: int, tol: float) -> None:
14851485
# Handle both single value and array cases
14861486
if isinstance(distances, np.ndarray) and len(distances) > 1:
14871487
distances_slice = distances[1:]
1488-
indices_slice = indices[1:] if isinstance(indices, np.ndarray) else np.array([], dtype=int)
1488+
indices_slice = (
1489+
indices[1:]
1490+
if isinstance(indices, np.ndarray)
1491+
else np.array([], dtype=int)
1492+
)
14891493
else:
14901494
# Single value or empty case - no neighbors to process
14911495
distances_slice = np.array([])
14921496
indices_slice = np.array([], dtype=int)
14931497

14941498
# Filter out zero distances (duplicate coordinates)
14951499
valid_pairs = [
1496-
(d, idx) for d, idx in zip(distances_slice, indices_slice) if d > ZERO_THRESHOLD
1500+
(d, idx)
1501+
for d, idx in zip(distances_slice, indices_slice)
1502+
if d > ZERO_THRESHOLD
14971503
]
14981504

14991505
# Assign neighbors to shells

0 commit comments

Comments
 (0)