Skip to content

Commit 31591c6

Browse files
committed
Clarify term and automaton compression schedules
1 parent 64dd12c commit 31591c6

4 files changed

Lines changed: 236 additions & 102 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ Changes for the next release should be added here before the version is bumped.
3333

3434
- Unified the Hamiltonian `to_*` conversion surface around the single
3535
strategy-bearing `compress=` control. `compress=True`/`"auto"` now select a
36-
workload-aware full-sum construction with one final compression;
37-
`compress="automaton"` forces shared/state-diagram assembly, while
38-
`compress="term"` is the explicit after-each-term strategy. `compress=False`
39-
disables compression; `mode=` and `compress_each=` remain compatibility
40-
spellings. Automatic native tree conversions also choose a layout from the
41-
interaction supports when no plan or mapping is supplied.
36+
workload-aware construction: automaton assembly gets one final compression,
37+
while the term route compresses after every term. `compress="automaton"`
38+
forces shared/state-diagram assembly, while `compress="term"` is the
39+
explicit after-each-term strategy. `compress=False`, `max_bond=None`, and
40+
`max_bond=False` disable numerical compression; `mode=` and
41+
`compress_each=` remain compatibility spellings. Automatic native tree
42+
conversions also choose a layout from the interaction supports when no plan
43+
or mapping is supplied.
4244
`TreeMPO.show()` now keeps the clean native ASCII tree as its default, and
4345
`TreePEPO` retains its `TreePepsLayoutFinder` metadata through later
4446
operations.

docs/api/operators/hamiltonians.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,27 @@ assert all(isinstance(tensor.data, torch.Tensor) for tensor in mpo)
5959

6060
When `data_type` is omitted, the builder infers it from the converter's target
6161
dtype. Without `to_backend`, it defaults to `float64`. `chi` is an alias for
62-
`max_bond`; `form="left"` is forwarded to Quimb's compressor. Additional
63-
Quimb compression keywords can be supplied through `compress_opts`.
62+
`max_bond`; `form="left"` is forwarded to Quimb's compressor. An omitted
63+
`max_bond` inherits the builder cap, while `max_bond=None` or `False` disables
64+
numerical compression. Additional Quimb compression keywords can be supplied
65+
through `compress_opts`.
6466

6567
Use `compress="automaton"` to canonicalize equivalent terms, compile the
6668
complete list with Pepsy's shared finite-state MPO automaton, and then apply
67-
one final numerical compression to `chi`. `compress=True` is the same
68-
workload-aware automatic policy as `compress="auto"`: it uses the automaton
69-
when its estimated structural width is reasonable, and otherwise uses a
70-
sequential term sum with one final compression. `compress="term"` is the
71-
explicit incremental policy and compresses after each term. `compress=False`
72-
disables numerical compression. The older separate `mode=` keyword remains
73-
accepted for compatibility.
69+
one final numerical compression to `chi` when a bond cap is active.
70+
`compress=True` is the same workload-aware automatic policy as
71+
`compress="auto"`: it uses the automaton when its estimated structural width
72+
is reasonable, and otherwise uses a sequential term sum with compression
73+
after every term. `compress="term"` is the explicit incremental policy and
74+
also compresses after every term. `compress=False`, `max_bond=None`, and
75+
`max_bond=False` disable numerical compression while preserving the selected
76+
exact construction. The older separate `mode=` keyword remains accepted for
77+
compatibility.
7478

7579
The automaton preparation combines duplicate product terms, folds all one-site
7680
terms acting on the same site, and removes identity factors from two-site
77-
terms. These are exact algebraic simplifications; `chi` and `cutoff` still
78-
control only the final numerical compression.
81+
terms. These are exact algebraic simplifications; `chi` and `cutoff` control
82+
the numerical compression sweep(s) selected by the construction strategy.
7983

8084
For a 2D builder, locations can be lattice coordinates and are mapped through
8185
`OneDMap`; a one-site coordinate can be written as `((x, y),)`:
@@ -140,17 +144,20 @@ retained physical spanning tree; the builder's ordinary map remains the
140144
logical site order. Both resulting state/operator families report the same
141145
mode through `.map_mode` when they share a plan. Historical generic PEPO map
142146
spellings remain accepted for compatibility. Both native methods accept
143-
`compress=True` (the default, equivalent to `compress="auto"`) chooses the
144-
workload-aware native state-diagram route and compresses once after the
145-
complete sum. With no explicit `plan`, `map_mode`, or `tree_order`, the same
146-
policy chooses a TreePlan/TreePepsPlan from the term-support graph; an explicit
147-
plan or mapping always wins. `compress="automaton"` forces full native
148-
assembly and one final compression, while `compress="term"` adds and
149-
compresses one term at a time. The native tree compression options are
147+
`compress=True` (the default, equivalent to `compress="auto"`) and choose the
148+
workload-aware native state-diagram route. Automaton assembly receives one
149+
final compression; term assembly compresses after every added term. With no
150+
explicit `plan`, `map_mode`, or `tree_order`, the same policy chooses a
151+
TreePlan/TreePepsPlan from the term-support graph; an explicit plan or mapping
152+
always wins. `compress="automaton"` forces full native assembly, while
153+
`compress="term"` adds and compresses one term at a time. These numerical
154+
compressions require an effective bond cap. The native tree compression options are
150155
`order="rank"` or
151156
`order="depth"` for `TreeMPO`, and `form`, `center`, and `reduced` for
152157
`TreePEPO`; common `max_bond`, `cutoff`, and `cutoff_mode` values come from
153-
`ham_tn` unless overridden. For a consistent conversion API, `compress=` is
158+
`ham_tn` unless overridden. An omitted `max_bond` inherits that builder cap;
159+
`max_bond=None` or `False` disables numerical compression. For a consistent
160+
conversion API, `compress=` is
154161
the single canonical strategy control accepted by all four `to_*` methods:
155162
use `True`, `False`, or the explicit strategy strings
156163
`"term"`/`"automaton"`/`"auto"`. Passing `to_backend=None` explicitly

0 commit comments

Comments
 (0)