LmCast :: Stay tuned in

Show HN: Differentiable Quantum Chemistry

Recorded: Jan. 22, 2026, 11:03 a.m.

Original Summarized

GitHub - lowdanie/hartree-fock-solver: A quantum chemisty library in jax.

Skip to content

Navigation Menu

Toggle navigation

Sign in

Appearance settings

PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback


We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

lowdanie

/

hartree-fock-solver

Public

Notifications
You must be signed in to change notification settings

Fork
0

Star
28

A quantum chemisty library in jax.

License

Apache-2.0 license

28
stars

0
forks

Branches

Tags

Activity

Star

Notifications
You must be signed in to change notification settings

Code

Issues
0

Pull requests
0

Actions

Projects
0

Security

Uh oh!

There was an error while loading. Please reload this page.


Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security

Insights

lowdanie/hartree-fock-solver

 mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History112 Commits.github/workflows.github/workflows  assets/imagesassets/images  notebooksnotebooks  slaterformslaterform  teststests  .gitignore.gitignore  LICENSELICENSE  README.mdREADME.md  coverage.svgcoverage.svg  pyproject.tomlpyproject.toml  View all filesRepository files navigationREADMEApache-2.0 license

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.Atom("H", 1, jnp.array([1.14668581, -0.45032174, -1.35474466], dtype=jnp.float64)),
], basis_name="sto-3g",
)

# Jit compile and run SCF to solve for the energy.
result = jax.jit(scf.solve)(mol)

print(f"Total Energy: {result.total_energy} H")
print(f"Electronic Energy: {result.electronic_energy} H")
Output:
Total Energy: -74.96444760738025 H
Electronic Energy: -84.04881211726543 H

We can now evaluate the electron density on the points of a grid and save the result to a
cube file so that we can render it with tools like
3dmol.
grid = sf.analysis_grid.build_bounding_grid(mol)
density_data = sf.analysis.evaluate(result.basis.basis_blocks, result.density, grid)

with open('density.cube', 'w') as f:
sf.analysis.write_cube_data(
mol=mol, grid=grid, data=density_data,
description="density", f=f
)
Here is what the result looks like rendered by 3dmol:

Installation
git clone https://github.com/lowdanie/hartree-fock-solver.git
cd hartree-fock-solver

pip install -e .
Tests
This project uses pytest for testing and pytest-cov for coverage.
# Run the standard test suite (skips slow tests by default)
pytest

# Run all tests (including slow ones)
pytest -m ""

# Check code coverage
pytest --cov=slaterform
Theory
For the details of the math, physics and algorithms behind this library see:

Hartree Fock I: Ground State Estimation
Hartree Fock II: Electron Integrals

About

A quantum chemisty library in jax.

Topics

chemistry

quantum

quantum-chemistry

hartree-fock

jax

quantum-simulation

Resources

Readme

License

Apache-2.0 license

Uh oh!

There was an error while loading. Please reload this page.


Activity
Stars

28
stars
Watchers

0
watching
Forks

0
forks

Report repository

Releases
No releases published

Packages
0

No packages published

Contributors
2

lowdanie

actions-user

Languages

Python
54.2%

Jupyter Notebook
45.8%

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

This GitHub repository, maintained by lowdanie, provides a quantum chemistry library implemented in JAX. The library, named “hartree-fock-solver,” offers a differentiable Hartree-Fock engine designed for quantum simulations. It’s intended for researchers and developers working in the field of quantum chemistry, specifically those leveraging the JAX framework for its performance and automatic differentiation capabilities. The library facilitates the computational solution of the Hartree-Fock equations, a cornerstone of electronic structure theory.

The core functionality centers around the `slaterform` module, which offers a streamlined approach to setting up and solving Hartree-Fock calculations. A key feature is the integration of ‘basis set exchange,’ allowing users to incorporate commonly used sets of atomic orbitals (such as STO-3G) directly within the code. This removes the need for separate input files and simplifies the workflow. The system provides a way to efficiently estimate the ground state energy of molecules.

The library’s implementation relies heavily on JAX, allowing for efficient computation and automatic differentiation. The code compiles using `jax.jit`, enhancing its performance. Users can perform geometry optimizations by minimizing the total energy function. This optimization is achieved through standard JAX optimization loops. The code includes illustrative examples, like the computation of the electronic ground state of methane, demonstrating the library’s ease of use. The example shows the optimization process, from initializing nuclear positions to obtaining the final energy.

A significant component is the ability to evaluate the electron density on a grid and save it in a ‘cube’ format for visualization using tools like 3dmol. This feature provides a way to gain insight into the distribution of electron density within a molecule, which is crucial for understanding its properties. This functionality is facilitated by a grid building and density evaluation module. The repository’s documentation includes detailed instructions on installation and usage, further accessible through Jupyter Notebooks, offering a hands-on approach to learning and experimentation.

The project implements standard test suites using `pytest` and `pytest-cov` for code coverage analysis. Users can run both standard and full test suites. The included documentation references relevant resources, including theoretical background on Hartree-Fock theory and electron integrals. The core library is built around a moduler design, and utilizes a modular framework for both data evaluation and rendering.

The library prioritizes ease of use and integration with existing research workflows. It presents a relatively straightforward approach to Hartree-Fock calculations, leveraging the advantages of JAX for high-performance computations. This makes it a valuable tool for researchers interested in exploring and developing quantum chemistry algorithms. The clear documentation and examples facilitate adoption and experimentation, encouraging further development and utilization of the library within the broader field of quantum simulation.