openmaterials.ai / codes / smol

smol: cluster expansions and Monte Carlo on lattices

Builds generalized cluster expansions on pymatgen structures, fits them to first-principles energies and samples canonical and semigrand canonical ensembles by Monte Carlo.

What it is and how it works

Energy as a function of occupancy

In H(sigma) = sum over beta of m_beta J_beta Theta_beta(sigma), correlation functions over symmetry-equivalent clusters multiply fitted coefficients. The function set may be a basis or redundant (Barroso-Luque 2022).

smol.cofe

Site function sets (polynomial, trigonometric, indicator) and cluster orbits from a disordered pymatgen structure with species, charges or vacancies (Barroso-Luque 2022).

Extra interaction terms

An optional electrostatic pair potential for ionic structures improves training convergence. Other pair or strain terms fit the same slot (Barroso-Luque 2022).

smol.moca

Monte Carlo in canonical and semigrand canonical ensembles. Proposals, ensembles, traces and kernels are separate objects. Updates run in Cython (Barroso-Luque 2022).

Fitting

Coefficients come from regularized linear regression, for instance lasso on the l1 norm of the ECIs with the penalty tuned by fivefold cross-validation (Xie 2024).

Materials Project stack

The only cluster expansion package built on pymatgen, so FireWorks, atomate and database tools slot in around it (Barroso-Luque 2022).

What people do with it

  • 0.5 meVRMSE per atom, Ag-Li gamma-brass expansionXie 2024
  • 1,000,000Metropolis steps per T at or below 500 KXie 2024

Ag-Li free energies for anode-free cells

Cluster expansions for BCC, FCC and gamma-brass (RMSE 3.3, 1.5 and 0.5 meV/atom), canonical MC and thermodynamic integration give free energies. Four phases stable at 200 K, two at 300 K. Xie 2024

Paddlewheel effect in Li3PS4

Low-energy Li/vacancy orderings of alpha and beta Li3PS4 also came from smol cluster expansion Monte Carlo. NEB puts a 120 degree PS4 rotation above 1 eV and a Li hop in beta at 0.112 eV. Jun 2024

How it is used

  1. Define the lattice model

    A disordered pymatgen Structure with allowed species per site, cutoffs per cluster size.

  2. Compute training data

    Enumerate orderings, relax with DFT, collect energies as the fitting targets.

  3. Fit the expansion

    Build the feature matrix in smol.cofe, fit ECIs by regularized regression, check CV error.

  4. Sample

    Run canonical or semigrand Monte Carlo in smol.moca over temperature and composition.

  5. Integrate

    Average energy, heat capacity, free energy by thermodynamic integration, ground states.