Artifact¶
Density-matrix snapshot at one TgTRG cooling step (ρ(β), beta, step).
Artifact
dataclass
¶
Bases: AlgorithmSummary
Density-matrix snapshot at one TgTRG cooling step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
NormalMPO
|
Thermal density matrix |
required |
beta
|
float
|
Inverse temperature of this snapshot. |
required |
step
|
int
|
Step index: |
required |
Methods:¶
serialize
¶
Serialize the artifact to a plain dict compatible with torch.save.
Returns:
| Type | Description |
|---|---|
dict
|
Serialized artifact. |
deserialize
classmethod
¶
Reconstruct an Artifact from a dict produced by serialize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Dict previously returned by |
required |
device
|
str
|
Device to place all tensor blocks on. Defaults to |
'cpu'
|
Returns:
| Type | Description |
|---|---|
Artifact
|
Reconstructed artifact. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
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
0is after Taylor init (ρ(τ₀)). - Step
k(1 … n_steps) is after thek-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_everythins the archive: a stride ofkkeeps everyk-th step, plus the final one regardless of the stride.tgtrg.ckptis overwritten each step and deleted whenrun()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.