Options¶
TgTRG run options.
Options
dataclass
¶
Options(
scheme: str = "2s",
grid: str = "exp",
tau_0: float = 2**-12,
tau: float = 0.1,
n_steps: int = 13,
taylor_order: int = 10,
order: int = 2,
max_bond: Optional[int] = None,
trunc_thresh: float = 1e-12,
krylov_dim: int = 16,
krylov_tol: float = 1e-12,
obs_exact: bool = False,
env_cache_dir: Optional[str] = None,
env_async_io: bool = True,
env_window: int = 2,
checkpoint_dir: Optional[str] = None,
artifacts_dir: Optional[str] = None,
save_artifacts: bool = True,
save_artifacts_every: int = 1,
)
Bases: AlgorithmOptions
TgTRG 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 cooling step. Canonical values and aliases:
|
'2s'
|
grid
|
str
|
β-grid mode, |
'exp'
|
tau_0
|
float
|
Inverse temperature of the initial Taylor state, ≈ 2⁻¹². Small
enough that the Taylor expansion converges. On the exponential grid
it also fixes the whole grid, |
2 ** -12
|
tau
|
float
|
Step size for |
0.1
|
n_steps
|
int
|
Absolute step index to stop at, counted from the Taylor state — not
a number of additional steps to perform. On the exponential grid the
final inverse temperature is |
13
|
taylor_order
|
int
|
Truncation order of the Taylor series for |
10
|
order
|
int
|
Integrator order: |
2
|
max_bond
|
Optional[int]
|
Maximum bond dimension of |
None
|
trunc_thresh
|
float
|
Singular-value truncation threshold: a value is discarded when it
falls below |
1e-12
|
krylov_dim
|
int
|
Maximum Krylov subspace dimension per local propagator. |
16
|
krylov_tol
|
float
|
Relative convergence threshold for the Krylov expansion, on the weight the propagator puts on the newest direction. |
1e-12
|
obs_exact
|
bool
|
If |
False
|
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
|
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_every
|
int
|
Stride on the step index for archiving artifacts, independent of the cooling grid. The final step of a run is always archived whatever the stride, so a finished run leaves a resumable endpoint for the next phase of a stacked schedule to pick up. |
1
|
TOML Loading¶
Options can be loaded directly from a TOML section:
import tomllib
from alice.algorithm import tgtrg
with open("config.toml", "rb") as f:
cfg = tomllib.load(f)
opts = tgtrg.Options.from_toml(cfg["free_fermion"]["algorithm"])
Every option is a scalar or a string, so a stacked schedule is two sections:
[free_fermion.cooling_exp]
scheme = "2s"
grid = "exp"
tau_0 = 0.000244140625 # 2^{-12}
n_steps = 13 # -> beta = 2
order = 2
max_bond = 64
trunc_thresh = 1e-12
[free_fermion.cooling_lin]
scheme = "2s"
grid = "lin"
tau_0 = 0.000244140625
tau = 0.5
n_steps = 33 # -> beta = 2 + 31 * 0.5
order = 2
max_bond = 64
trunc_thresh = 1e-12
tau_0 is carried into the linear section because the recovered history was
built on it; n_steps counts from the Taylor state in both.