Options¶
XTRG run options.
Options
dataclass
¶
Options(
scheme: str = "2s",
tau_0: float = 2**-12,
n_steps: int = 20,
taylor_order: int = 10,
max_bond: Optional[int] = None,
trunc_thresh: float = 1e-15,
n_sweeps: int = 4,
z_tol: float = 1e-10,
env_cache_dir: Optional[str] = None,
env_async_io: bool = True,
env_window: int = 2,
expand_k: int = 4,
expand_alpha: Optional[int] = None,
checkpoint_dir: Optional[str] = None,
artifacts_dir: Optional[str] = None,
save_artifacts: bool = True,
save_artifacts_since: int = 0,
)
Bases: AlgorithmOptions
XTRG run options.
All fields have sensible defaults so Options() is a valid minimal
configuration. Use Options.from_toml to load from a TOML section, or
Options.load_toml to read directly from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme
|
str
|
Update scheme per squaring step. Canonical values and aliases: |
'2s'
|
tau_0
|
float
|
Initial inverse temperature ≈ 2⁻¹² ≈ 2.44 × 10⁻⁴. Should be small enough that the Taylor expansion converges, and is doubled at each step: β_n = 2^n × τ₀. |
2 ** -12
|
n_steps
|
int
|
Number of doubling steps. The final inverse temperature is β_max = 2^n_steps × τ₀. |
20
|
taylor_order
|
int
|
Truncation order of the Taylor series for ρ(τ₀) = e^{-τ₀ H}. Higher order increases accuracy and bond dimension of the initial ρ. |
10
|
max_bond
|
Optional[int]
|
Maximum bond dimension of the compressed ρ. |
None
|
trunc_thresh
|
float
|
Singular value truncation threshold (relative to the largest singular value per charge sector). |
1e-15
|
n_sweeps
|
int
|
Maximum number of full variational sweeps (forward + backward) per
squaring step. A sweep may stop early once |
4
|
z_tol
|
float
|
Convergence tolerance for the inner variational fit: sweeping stops
early once |
1e-10
|
env_cache_dir
|
Optional[str]
|
Root directory for environment disk caching. When set, |
None
|
env_async_io
|
bool
|
If |
True
|
env_window
|
int
|
Number of environment blocks to keep in memory at once when disk caching is enabled. |
2
|
expand_k
|
int
|
Maximum number of complement vectors added to each bond end per CBE
step. Only used when |
4
|
expand_alpha
|
Optional[int]
|
Internal connector-bond dimension used by the cheap per-operand SVD
compression inside the CBE expansion (Eq. 13 of arXiv:2510.25022).
Only used when |
None
|
checkpoint_dir
|
Optional[str]
|
Directory for checkpoint files. After every cooling step a
|
None
|
artifacts_dir
|
Optional[str]
|
Directory for per-step |
None
|
save_artifacts
|
bool
|
If |
True
|
save_artifacts_since
|
int
|
First step index (inclusive) at which |
0
|
TOML Loading¶
Options can be loaded directly from a TOML section:
import tomllib
from alice.algorithm import xtrg
with open("config.toml", "rb") as f:
cfg = tomllib.load(f)
opts = xtrg.Options.from_toml(cfg["free_fermion"]["algorithm"])
Example TOML block:
[free_fermion.algorithm]
scheme = "2s"
tau_0 = 0.000244140625 # 2^{-12}
n_steps = 20
max_bond = 64
trunc_thresh = 1e-12
n_sweeps = 4