并行化支持完善
Some checks failed
Build wheels / build (ubuntu-latest, 3.11) (push) Has been cancelled
Build wheels / build (ubuntu-latest, 3.12) (push) Has been cancelled
Build wheels / build (ubuntu-latest, 3.13) (push) Has been cancelled
Tests / check (push) Has been cancelled
Tests / build (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / build (ubuntu-latest, 3.12) (push) Has been cancelled
Tests / build (ubuntu-latest, 3.13) (push) Has been cancelled

This commit is contained in:
2026-05-07 23:26:53 +08:00
parent fbae48eb3d
commit 2f5c863952
9 changed files with 195 additions and 93 deletions

13
check_tree.py Normal file
View File

@@ -0,0 +1,13 @@
"""Check contraction tree statistics."""
import pickle, sys
path = sys.argv[1] if len(sys.argv) > 1 else "data/tree_q25_l10.pkl"
with open(path, 'rb') as f:
tree = pickle.load(f)
print(f"File: {path}")
print(f"Peak memory elements: {tree.max_size():.2e}")
print(f"Peak memory (GB): {tree.max_size() * 16 / 1e9:.2f}") # complex128 = 16 bytes
print(f"Total FLOPs: {tree.total_flops():.2e}")
print(f"Contraction width: {tree.contraction_width()}")
print(f"Multiplicity (slices): {tree.multiplicity}")