Skip to content

Artifact

Density-matrix snapshot at one XTRG cooling step (ρ(β), beta, step).

Artifact dataclass

Artifact(rho: NormalMPO, beta: float, step: int)

Bases: AlgorithmSummary

Density-matrix snapshot at one XTRG cooling step.

Parameters:

Name Type Description Default
rho NormalMPO

Thermal density matrix ρ(β) as a NormalMPO.

required
beta float

Inverse temperature of this snapshot.

required
step int

Step index: 0 after Taylor init; k after the k-th squaring.

required

Methods:

serialize

serialize() -> dict

Serialize the artifact to a plain dict compatible with torch.save.

Returns:

Type Description
dict

Serialized artifact.

deserialize classmethod

deserialize(data: dict, device: str = 'cpu') -> Artifact

Reconstruct an Artifact 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 tensor blocks on. Defaults to 'cpu'.

'cpu'

Returns:

Type Description
Artifact

Reconstructed artifact with the density matrix on device.

Raises:

Type Description
ValueError

If data["version"] is not 1.

On-disk layout

Under the checkpoint directory (Options.checkpoint_dir, or cwd) and the artifacts directory (Options.artifacts_dir, or artifacts/ under the checkpoint directory):

checkpoint_dir/
  thermal.ckpt         # latest Summary (kept after success)
  xtrg.ckpt            # latest Artifact while running (removed on success)
  artifacts/           # or Options.artifacts_dir, when set
    step_00.ckpt       # when Options.save_artifacts is True
    step_01.ckpt
    ...
  • Step 0 is after Taylor init (ρ(τ₀)).
  • Step k (1 … n_steps) is after the k-th squaring.
  • Files use two-digit zero padding (step_{k:02d}.ckpt).
  • xtrg.ckpt is overwritten each step and deleted when run() finishes successfully; a crash leaves it on disk for inspection.
from alice.algorithm.xtrg import Artifact

artifact = Artifact.load("artifacts/step_05.ckpt")
rho = artifact.rho
print(artifact.beta, artifact.step)

See Also

  • Summary — thermodynamic history without ρ.
  • Options — artifacts_dir / save_artifacts / save_artifacts_since.
  • run — returns (Summary, Artifact).
  • NormalMPO — type of artifact.rho.