YAML Configuration System
qvartools experiment scripts support a three-tier configuration system:
Built-in defaults — sensible values for all parameters
YAML config files — reproducible experiment configurations
CLI overrides — quick parameter adjustments
CLI arguments take precedence over YAML values, which take precedence over built-in defaults.
Using Config Files
Each pipeline group has a matching YAML config in
experiments/pipelines/configs/:
python experiments/pipelines/02_nf_dci/nf_dci_krylov_classical.py \
--config experiments/pipelines/configs/02_nf_dci.yaml
CLI Overrides
Any parameter can be overridden on the command line:
# Use YAML config but override the molecule and max epochs
python experiments/pipelines/02_nf_dci/nf_dci_krylov_classical.py lih \
--config experiments/pipelines/configs/02_nf_dci.yaml \
--max-epochs 200 \
--teacher-weight 0.6
Available Config Files
File |
Pipeline Group |
|---|---|
|
Direct-CI (HF+S+D) — no NF training |
|
NF-trained + Direct-CI merged basis |
|
NF + DCI + PT2 perturbative expansion |
|
NF-only basis (ablation, no DCI merge) |
|
HF-only reference state (baseline) |
|
Iterative NQS sampling + diag |
|
NF+DCI merge then iterative NQS |
|
NF+DCI+PT2 then iterative NQS |
Config File Structure
A typical YAML config file looks like this:
# ---- Molecule -----------------------------------------------
molecule: h2 # Molecule identifier
# ---- Training loss weights ----------------------------------
teacher_weight: 0.5 # Teacher KL-divergence weight
physics_weight: 0.4 # Physics-informed energy weight
entropy_weight: 0.1 # Entropy regularisation weight
# ---- Training parameters ------------------------------------
max_epochs: 400 # Maximum training epochs
min_epochs: 100 # Minimum before early stopping
samples_per_batch: 2000 # Samples per training batch
# ---- SKQD parameters ----------------------------------------
max_krylov_dim: 15 # Maximum Krylov dimension
shots_per_krylov: 100000 # Shots per Krylov vector
# ---- Hardware -----------------------------------------------
device: auto # auto, cpu, or cuda
All keys are flat (no nested sections). Keys use underscores and match the
PipelineConfig field names where applicable.
Parameter Reference
Common Parameters
Parameter |
Default |
Description |
|---|---|---|
|
|
Molecule identifier (h2, lih, beh2, h2o, nh3, ch4, n2, c2h4) |
|
|
PyTorch device: |
|
|
Print detailed progress |
Training Parameters
Parameter |
Default |
Description |
|---|---|---|
|
|
Weight for teacher KL-divergence loss |
|
|
Weight for variational energy loss |
|
|
Weight for entropy regularization |
|
auto-scaled |
Maximum training epochs |
|
auto-scaled |
Minimum epochs before early stopping |
|
auto-scaled |
Samples drawn per training batch |
SKQD Parameters
Parameter |
Default |
Description |
|---|---|---|
|
auto-scaled |
Maximum Krylov subspace dimension |
|
auto-scaled |
Shot budget per Krylov vector |
SQD Parameters
Parameter |
Default |
Description |
|---|---|---|
|
auto-scaled |
Number of SQD sample batches |
|
|
Self-consistent iteration count |
|
auto-scaled |
Bitflip noise rate for shot simulation |
Auto-Scaling
When parameters are not specified in the config file or CLI, qvartools automatically scales them based on the Hilbert-space size. This auto-scaling uses the number of valid configurations (determined by the molecule’s orbital and electron counts) to choose appropriate values for training epochs, samples, network sizes, and SKQD/SQD parameters.
Explicit config values always override auto-scaled defaults.