Summary¶
VUMPS output dataclass.
Summary
dataclass
¶
Summary(
energy: float,
state: iMPS,
energies: List[float] = list(),
converged: bool = False,
n_iters: int = 0,
bond_dims: List[int] = list(),
gradients: List[float] = list(),
discarded_weights: List[float] = list(),
)
Bases: AlgorithmSummary
VUMPS output.
Attributes:
| Name | Type | Description |
|---|---|---|
energy |
float
|
Final ground-state energy per site, from the environment fixed point after the last iteration. |
state |
iMPS
|
Optimized iMPS, gauge-fixed. |
energies |
List[float]
|
Energy per site recorded at the end of each iteration. |
converged |
bool
|
|
n_iters |
int
|
Actual number of iterations performed. |
bond_dims |
List[int]
|
Bond dimensions of |
gradients |
List[float]
|
VUMPS gradient norm recorded at each iteration. |
discarded_weights |
List[float]
|
Largest weight discarded by a split, recorded at each iteration.
All zeros under |
Methods:¶
serialize
¶
Serialize the summary to a plain dict compatible with torch.save.
The iMPS state is serialized via iNetwork.serialize, which produces
a weights_only-safe dict of tensors and primitives.
Returns:
| Type | Description |
|---|---|
Dict
|
Serialized summary with keys |
deserialize
classmethod
¶
Reconstruct a Summary from a dict produced by serialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dict
|
Dict previously returned by |
required |
device
|
str
|
Device to place all iMPS tensor blocks on. Defaults to |
'cpu'
|
Returns:
| Type | Description |
|---|---|
Summary
|
Reconstructed summary with the iMPS state placed on |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Serialization¶
import torch
payload = summary.serialize()
torch.save(payload, "state.pt")
# Reload
data = torch.load("state.pt", weights_only=True)
summary = vumps.Summary.deserialize(data, device="cpu")