Show HN: Differentiable Quantum Chemistry

https://news.ycombinator.com/rss Hits: 3
Summary

Slaterform slaterform is a differentiable Hartree-Fock engine written in jax . It includes a native implementation of the necessary electron integrals and supports standard basis sets from basis set exchange. Example: Geometry Optimization Because slaterform is written in pure jax , it can easily be used to define a differentiable molecular energy function. This function can be minimized in a standard jax optimization loop to optimize the molecular geometry. import jax import slaterform as sf import slaterform . hartree_fock . scf as scf def total_energy ( molecule : sf . Molecule ): """Compute the total energy of the molecule with Hartree-Fock""" options = scf . Options ( max_iterations = 20 , execution_mode = scf . ExecutionMode . FIXED , integral_strategy = scf . IntegralStrategy . CACHED , perturbation = 1e-10 , ) result = scf . solve ( mol , options ) return result . total_energy # Add gradients and JIT compile. total_energy_and_grad = jax . jit ( jax . value_and_grad ( total_energy )) In this colab notebook you can select a molecule, optimize the nuclear positions with optax , and finally visualize the trajectory of the nuclei and electron density using 3dmol. Here is a sample output for methane. We initialize the nuclei to lie flat on a plane, and the optimizer moves them into the classic tetrahedral configuration. The blue cloud is rendered by sampling the electron density returned by scf.solve . methane.mp4 Quick Start Here is an example which estimates the electronic ground state of water using the STO-3G basis set from basis set exchange. import jax import jax . numpy as jnp import slaterform as sf import slaterform . hartree_fock . scf as scf # Build the H2O molecule with nuclear positions from pubchem and the sto-3g basis set. mol = sf . Molecule . from_geometry ( [ sf . Atom ( "O" , 8 , jnp . array ([ 0.0 , 0.0 , 0.0 ], dtype = jnp . float64 )), sf . Atom ( "H" , 1 , jnp . array ([ 0.52421003 , 1.68733646 , 0.48074633 ], dtype = jnp . float64 )), sf . ...

First seen: 2026-01-22 05:42

Last seen: 2026-01-22 07:42