Skip to content

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

True if the gradient norm fell below opts.grad_tol before n_iters was reached.

n_iters int

Actual number of iterations performed.

bond_dims List[int]

Bond dimensions of state (length N, the last entry being the bond onto the next copy of the cell).

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 '1s', which never splits anything.

Methods:

serialize

serialize() -> Dict

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 "version", "energy", "energies", "converged", "n_iters", "bond_dims", "gradients", "discarded_weights", and "state".

deserialize classmethod

deserialize(data: Dict, device: str = 'cpu') -> Summary

Reconstruct a Summary from a dict produced by serialize.

Parameters:

Name Type Description Default
data Dict

Dict previously returned by serialize.

required
device str

Device to place all iMPS tensor blocks on. Defaults to 'cpu'.

'cpu'

Returns:

Type Description
Summary

Reconstructed summary with the iMPS state placed on device.

Raises:

Type Description
ValueError

If data["version"] is not 1.

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")

See Also

  • Options — input options.
  • run — returns a Summary.