add organized and modular hydra configuration as well as 3 eigensolver modes: 1) cholesky transform (direct, ideal for dense matrices), 2) vqe (stub, we can populate later), and 3) lanczos algorithm (ideal for sparse matrices, near linear time complexity for extremal eigenvalues) - #7
Open
crhysc wants to merge 3 commits into
Open
crhysc wants to merge 3 commits into
crhysc wants to merge 3 commits into
Conversation
added 3 commits
April 24, 2026 11:50
Replace O(N_cells·N²) dense distance allocation with matscipy cell-list neighbor detection (O(N·z̄)), then rebuild only the relevant cells differentiably from positions so autograd is preserved for forces/stress. Batch all k-points into a single eighb call instead of a Python for-loop, removing serial overhead and letting cuBLAS/LAPACK parallelize across k-points.
Replaces JSON config + Pydantic BaseSettings + argparse with a structured Hydra config hierarchy, making all hardcoded hyperparameters composable YAML and ensuring training/prediction entry points are unit-testable without the Hydra runtime. Key changes: - slakonet/conf.py: dataclass-based structured configs (DataConfig, TrainingConfig, OptimizerConfig, ModelConfig, PredictionConfig) that serve as the schema for both YAML files and direct OmegaConf instantiation in tests - conf/: YAML config tree with groups data/, training/, optimizer/, model/, prediction/; includes training/quick.yaml for fast debug runs - train_slakonet.py: run_training(cfg: DictConfig) callable + @hydra.main - predict_slakonet.py: run_prediction(cfg: DictConfig) callable + @hydra.main; energy_range is now a typed list, not a split string - optim.py: set_random_seed() extracted from module-level; kpoints, scheduler factor/patience, and regularization weights added as params to train_multi_vasp_skf_parameters; get_cache_dir fallback for jarvis compat - tests/conftest.py: session-scoped model fixture, minimal_train_cfg via OmegaConf.structured (no Hydra runtime or network needed) - tests/test_config.py: 6 schema/composition tests running in <0.25s - tests/test_bands.py: default_model() moved to session fixture; tests use fixtures and run_training() directly
Introduces a SOLID-compliant plugin architecture for the generalized eigenvalue solver used in SimpleDftb's forward pass. The solver algorithm is now a first-class Hydra config group (eigsolver: cholesky_eigh | lanczos | vqe), selectable at runtime without code changes. - slakonet/eigsolvers/: new module with _EigSolver ABC (mirrors _SkFeed), CholeskyEighSolver (the correctly-named former 'QR' solver), LanczosSolver (finds m lowest eigenvalues via Krylov subspace with normal/modified GS or selective reorthogonalization), VqeSolver stub, and make_eigsolver factory - conf/eigsolver/: three YAML config files for each variant - conf.py: CholeskyEighConfig, LanczosConfig, VqeConfig dataclasses registered as eigsolver Hydra group - SimpleDftb accepts eigsolver=None (defaults to CholeskyEighSolver for backward compatibility); _solve_eigenvalue_problem delegates to self.eigsolver.solve - Lanczos seed v_0 is detached; gradients flow through matrix-vector products with H_tilde and eigh(T) back to H and S
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.