Skala

repository·main·Indexed 42 days ago

https://github.com/microsoft/skala

A neural network-based exchange-correlation functional for density functional theory (DFT) that predicts exchange-correlation energies with accuracy comparable to hybrid functionals at semi-local DFT computational costs. It provides integrations for PySCF (CPU and GPU via GPU4PySCF), ASE calculators, and C++ applications via LibTorch. Includes the skala-benchmark package (v2026.9) for running DFT benchmarks and generating performance reports.

Tokens
61.5K
Snippets
186
Records
255
Agent score
53%

What's inside Skala

  1. Overview of the Skala exchange-correlation functional

    main
    Skala is a deep-learning exchange-correlation functional designed to achieve chemical accuracy (less than 1 kcal/mol) across diverse chemical systems. Unlike traditional methods, it avoids expensive non-local features such as exact exchange or hand-crafted density convolutions. The model is trained on high-accuracy datasets including total atomization energies, thermochemical properties (ionization potentials, proton affinities), conformer energies, reaction paths, and non-covalent interactions.
  2. Understand the Skala model package

    main
    The skala-model package contains the trainable model definitions used to document and test the architecture behind Skala's published traced model checkpoints. It serves as the source of truth for the model architecture used in Skala's exchange-correlation functionals.
  3. Skala 1.1 Benchmark Results Summary

    main

    The Skala 1.1 functional demonstrates the following performance characteristics:

    • Atomization Energies (W4-17): Achieves chemical accuracy ($\sim$ 1 kcal/mol MAE).
    • Thermochemistry (GMTKN55): Achieves a WTMAD-2 of 2.72 kcal/mol, outperforming many range-separated hybrid functionals while maintaining the runtime efficiency of semi-local DFT.
    • Geometry Optimization: Converges to equilibrium structures with errors comparable to range-separated hybrid functionals.
    • Dipole Moments: Provides better prediction accuracy than state-of-the-art range-separated hybrid functionals.
    • Scaling: Exhibits asymptotic scaling behavior similar to a meta-GGA functional, with an approximate prefactor of 3 relative to r2SCAN.
  4. Run Skala DFT benchmarks with the skala-benchmark CLI

    main

    The skala-benchmark package is used to run Skala Density Functional Theory (DFT) benchmarks, collect performance measurements, and generate offline reports.

    If you are using the default Pixi environment, the package is installed as an editable package and provides the skala-benchmark command line interface.

    For detailed instructions on dataset setup, executing benchmarks, collecting results, and generating reports, refer to the official benchmark documentation.

    skala-benchmark
  5. Integrate Skala into electronic structure packages via GauXC

    main

    Skala is provided as an extension to the GauXC library. To use Skala, you must use the GauXC interface, which implements the evaluation of exchange-correlation functionals from an input density matrix. If your electronic structure package already interfaces with GauXC, you can integrate Skala by installing the version of GauXC that includes Skala support.

    For specific implementation details, refer to the following integration paths:

    • Python/Standalone: For high-level usage.
    • C++/C/Fortran Libraries: For low-level integration into compiled electronic structure codes.
    • API Reference: For detailed functional interface specifications.
  6. Configure Molecular Grid Settings

    main

    When creating a MolGrid, you can configure several parameters to control the accuracy and performance of numerical integration:

    Pruning Schemes (GauXC::PruningScheme)

    Determines how molecular grid weights are constructed from atomic grids.

    • Unpruned: No pruning applied.
    • Robust: Robust pruning scheme from Psi4.
    • Treutler: The Treutler pruning scheme.

    Radial Quadrature Schemes (GauXC::RadialQuad)

    • Becke
    • MuraKnowles
    • TreutlerAhlrichs
    • MurrayHandyLaming

    Default Atomic Grid Sizes (GauXC::AtomicGridSizeDefault)

    • FineGrid: 75 angular, 302 radial points.
    • UltraFineGrid: 99 angular, 590 radial points.
    • SuperFineGrid: 250 angular, 974 radial points.
    • GM3: 35 angular, 110 radial points.
    • GM5: 50 angular, 302 radial points.

    Batch Size (GauXC::BatchSize)

    Defines the number of grid points processed in parallel. While the default is 512, values around 10000 are recommended for better performance.

  7. Evaluate Skala-1.0 performance metrics and benchmarks

    main

    Skala-1.0 has been evaluated across five distinct benchmark types to measure different performance aspects of the exchange-correlation functional:

    1. Reaction Energies (W4-17 & GMTKN55): Measures accuracy of predicted reaction energies.
      • W4-17 Metric: Mean Absolute Error (MAE) in kcal/mol.
      • GMTKN55 Metric: Weighted total mean absolute deviations 2 (WTMAD-2) in kcal/mol.
    2. Geometry Optimization (CCse21, HMGB11, LMGB35): Evaluates convergence to reference equilibrium structures.
      • Metric: Absolute error in bond lengths (Angstrom) and bond angles.
    3. Dipole Moments (hait2018): Measures the quality of the self-consistent electron density.
      • Metric: Root Mean Square Error (RMSE) of percentage errors in dipole magnitude or vector.
    4. Computational Cost Scaling: Assesses how cost increases with system size.
      • Metric: Scaling power $k$ derived from a power law fit $C(M) = (n(M)/A)^k$, where $n(M)$ is the number of atoms.

    Performance Summary

    • W4-17: Predicts atomization energies at chemical accuracy ($\sim$ 1 kcal/mol MAE).
    • GMTKN55: Achieves a WTMAD-2 of 3.89 kcal/mol (competitive with range-separated hybrids but with semi-local DFT runtimes).
    • Geometry: Errors comparable to a GGA functional.
    • Dipole: Errors comparable to state-of-the-art range-separated hybrid functionals.
    • Scaling: Exhibits asymptotic scaling behavior of a meta-GGA functional (approx. 3x prefactor relative to r2SCAN).
  8. Risks and Limitations of Skala-1.0

    main

    Users should be aware of the following limitations:

    • Expertise Required: Interpretation of results requires expertise in quantum chemistry.
    • Generalization: While benchmarked on W4-17 and GMTKN55, users should test the functional further before applying it to new research.
    • Elemental Coverage: The model was trained on data containing elements H–Ar (excluding Li and Be) and Br, Kr, I, Xe. It has been tested on H–Ca, Ge–Kr, Sn–I, Pb, and Bi.
    • Not Production Ready: This is not a production model; it is intended for research purposes.
  9. Fortran bindings for Skala via FTorch

    main

    Interoperability between Skala (C++) and Fortran is achieved through custom extensions in the src/ directory. The bindings are implemented using C++/Fortran interoperability:

    • skala_ftorch.cxx: Contains the C++ code defining the interface.
    • skala_ftorch.f90: Contains the Fortran code providing the high-level bindings.

    These bindings allow Fortran applications to:

    • Load Skala models.
    • Prepare input features.
    • Compute exchange-correlation energies and potentials.
  10. Intended and Out-of-Scope Uses for Skala-1.0

    main

    Intended Uses

    • Research Reproduction: Facilitating the reproduction of evaluations presented in the Skala paper.
    • Reaction Energy Evaluation: Computing total energy of all compounds in a reaction using a self-consistent field (SCF) calculation.
    • Molecular Total Energy: Evaluating total energy of a molecule via SCF. Note that energy differences are predicted much more reliably than absolute total energies.
    • Integration: The provided SCF implementation uses PySCF (CPU). A traced version is available for integration into optimized or GPU-enabled SCF codes (e.g., via GauXC).

    Out-of-Scope Uses

    • Single-pass Evaluation: Evaluating the functional with a single pass given a fixed density is not the intended use. The model must be used as part of an SCF procedure.
    • Training: This repository does not include the training pipeline for the Skala-1.0 functional.
  11. Securely load .fun model files

    main

    Skala model files (.fun) use TorchScript serialization, which can execute arbitrary code. Never load .fun files from untrusted sources.

    When using official models via load_functional("skala-1.1") or load_functional("skala-1.0"), integrity is automatically verified. If loading files directly with TracedFunctional.load(), you must provide an expected_hash to enable verification.

    TracedFunctional.load("model.fun", expected_hash="<sha256-hex-digest>")