shehan807/pympfit: v1.0.0
Description
v1.0.0
First public release of PyMPFIT on PyPI.
PyMPFIT fits partial atomic charges to Gaussian Distributed Multipole Analysis (GDMA) outputs rather than to ESP grids, with support for multi-molecule constrained fitting, virtual sites, and Bayesian inference of virtual-site charges and geometries.
Lineage
PyMPFIT is a hard fork of shehan807/openff-PyMPFIT-fork, itself originally a fork of OpenFF Recharge. The mpfit kernel, SVD solver, Psi4/GDMA driver, storage layer, and constrained multi-molecule fitting machinery all matured over many months of development in that upstream lineage before being lifted into a standalone package for v1.0.0. The complete pre-fork commit history is preserved at the upstream repository.
Features
Distributed multipole computation
Psi4GDMAGeneratordrives Psi4 + GDMA in a subprocess to compute per-atom distributed multipoles from aMoleculeand conformer.GDMASettingsexposes basis, method, expansionlimit, integration radii, switching radius, and per-element radius overrides.
Storage
MoleculeGDMAStore(SQLite via SQLAlchemy) caches GDMA results keyed by canonical SMILES and fullGDMASettings, so the expensive QM step runs once and any number of downstream fits reuse it.
Charge fitting
generate_mpfit_charge_parameter— unconstrained single-molecule fit returning an openff-rechargeLibraryChargeParameter.MPFITSVDSolver— per-site SVD with a configurable singular-value cutoff.generate_constrained_mpfit_charge_parameter— multi-molecule joint fit with cross-molecule atom-type equivalence (Morgan-fingerprint typing viagenerate_global_atom_type_labels) and analytic per-molecule charge conservation.ConstrainedSciPySolver— analytic loss and Jacobian over a reduced parameter space, L-BFGS-B by default.
Virtual sites and Bayesian fitting
MPFITObjectiveexposes a torch-differentiablepredict()for sampling charges and virtual-site geometries with Pyro NUTS.- Supports openff-recharge virtual-site classes (
BondCharge, divalent lone pair, trivalent lone pair).
Multi-conformer
- Per-conformer fits are averaged with consistent atom ordering.
Documentation
- Sphinx site on ReadTheDocs — theory page, four tutorials (quickstart, constrained fitting, multi-molecule fitting, Bayesian virtual sites), and API reference.
Install
conda create -n pympfit python=3.12 openff-recharge openff-interchange openff-utilities psi4 pygdma -c conda-forge -y
conda activate pympfit
pip install pympfit==1.0.0
Optional Bayesian path: pip install pyro-ppl arviz matplotlib sphericart-torch
Files
shehan807/pympfit-v1.0.0.zip
Additional details
Related works
- Is supplement to
- Software: https://github.com/shehan807/pympfit/tree/v1.0.0 (URL)
Software
- Repository URL
- https://github.com/shehan807/pympfit