Skip to content

Artifact

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

Artifact dataclass

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

Bases: AlgorithmSummary

Density-matrix snapshot at one TgTRG 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 for the Taylor state, k after the k-th cooling step.

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.

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)
  tgtrg.ckpt           # latest Artifact while running (removed on success)
  artifacts/           # or Options.artifacts_dir, when set
    step_00000.ckpt    # when Options.save_artifacts is True
    step_00001.ckpt
    ...
  • Step 0 is after Taylor init (ρ(τ₀)).
  • Step k (1 … n_steps) is after the k-th cooling sweep.
  • Files use five-digit zero padding (step_{k:05d}.ckpt), enough for a linear phase of any length to sort in order.
  • Options.save_artifacts_every thins the archive: a stride of k keeps every k-th step, plus the final one regardless of the stride.
  • tgtrg.ckpt is overwritten each step and deleted when run() finishes successfully; a crash leaves it on disk for inspection.
from alice.algorithm.tgtrg import Artifact

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

An Artifact is also the handoff between the phases of a stacked schedule — the one run() returns is passed straight into the next run() call. See the overview.

See Also

  • Summary — thermodynamic history without ρ.
  • Options — artifacts_dir / save_artifacts / save_artifacts_every.
  • run — takes a starting Artifact, returns the final one.
  • Lessons — why an Artifact is consumed by the run it is given to.
  • NormalMPO — type of artifact.rho.