Options¶
DMRG run options.
Options
dataclass
¶
Options(
scheme: str = "1s",
n_sweeps: int = 10,
max_bond: Optional[int] = None,
trunc_thresh: float = 1e-15,
davidson_tol: float = 1e-10,
davidson_max_iter: int = 100,
davidson_max_subspace: int = 20,
e_tol: float = 1e-08,
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,
)
Bases: AlgorithmOptions
DMRG run options.
All fields have sensible defaults so Options() is a valid minimal
configuration. Use Options.from_toml to load from an [algorithm]
TOML section, or Options.load_toml to read directly from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme
|
str
|
Per-site update scheme. Canonical values and their aliases:
|
'1s'
|
n_sweeps
|
int
|
Maximum number of full sweeps (one forward + one backward half-sweep each). |
10
|
max_bond
|
Optional[int]
|
Maximum bond dimension kept at each QR step. |
None
|
trunc_thresh
|
float
|
SVD truncation threshold forwarded to |
1e-15
|
davidson_tol
|
float
|
Residual norm tolerance for the Davidson eigensolver. |
1e-10
|
davidson_max_iter
|
int
|
Maximum Davidson iterations per site optimisation. |
100
|
davidson_max_subspace
|
int
|
Maximum Krylov subspace size before a thick restart. |
20
|
e_tol
|
float
|
Energy convergence criterion: DMRG stops when |
1e-08
|
env_cache_dir
|
Optional[str]
|
Directory for environment block cache files. When set, each block is
serialised to |
None
|
env_async_io
|
bool
|
If |
True
|
env_window
|
int
|
Number of environment blocks kept in memory at once per direction
(current + prefetched ahead). Defaults to |
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 bond dimension used when forming the cheap 2-site tensor
Θ̃ = truncated SVD of M[i] ⊗ M[i+1] inside the CBE expansion.
Only used when |
None
|
checkpoint_dir
|
Optional[str]
|
Directory to write checkpoint files into. A |
None
|
TOML Loading¶
Options can be loaded directly from an [algorithm] TOML section:
import tomllib
from alice import dmrg
with open("config.toml", "rb") as f:
cfg = tomllib.load(f)
opts = dmrg.Options.from_toml(cfg["heisenberg"]["algorithm"])
Example TOML block: