Skip to content

MBIS psi4 support#2

Open
Awallace3 wants to merge 78 commits intoshehan807:mainfrom
Awallace3:mbis_psi4
Open

MBIS psi4 support#2
Awallace3 wants to merge 78 commits intoshehan807:mainfrom
Awallace3:mbis_psi4

Conversation

@Awallace3
Copy link

PR Summary: Add MBIS Psi4 Support to pympfit

This PR implements Minimal Basis Iterative Stockholder (MBIS) charge calculation support in pympfit, providing an alternative to Gaussian Distributed Multipole Analysis (GDMA) for computing partial atomic charges from quantum chemistry calculations. The goals here attempt to address requested enhancements from issue#1.

Key Features Implemented

Core MBIS Infrastructure:

  • pympfit/mbis/_mbis.py: Base MBISSettings and MBISGenerator classes following the GDMA pattern
  • pympfit/data/psi4/mbis.dat: Jinja2 template for Psi4 MBIS calculations supporting multipoles up to octupoles (l=0-3)
  • pympfit/mbis/psi4.py: Psi4MBISGenerator class for executing MBIS calculations via Psi4
  • pympfit/mbis/storage/_storage.py: MoleculeMBISRecord and MoleculeMBISStore classes for SQLite-backed storage

Multipole Transformation Utilities:

  • pympfit/mbis/multipole_transform.py: Comprehensive conversion between Cartesian (MBIS Psi4 native) and spherical harmonic (MPFIT-compatible) representations for dipoles, quadrupoles, and octupoles
  • pympfit/mbis/evaluate_cartesian_multipoles.py: Functions to compute electrostatic interaction energies using Cartesian multipole expansions

MPFIT Integration:

  • MBIS multipoles can be converted to spherical harmonics for compatibility with existing MPFIT charge fitting workflows, although the resulting fitted MBIS charges are meant as experimental
  • Support for both spherical and Cartesian multipole formats via multipole_format setting
  • Shared MPFIT parameters (inner/outer radius, atom radius) for consistent charge fitting

Status vs. Original Issue#1 Requirements

Completed:

  1. Jinja2 input.dat template for MBIS (pympfit/data/psi4/mbis.dat)
  2. MBISSettings and MBISGenerator classes (mirrors GDMA implementation)
  3. MoleculeMBISRecord and MoleculeMBISStore for SQLite backend
  4. Cartesian-to-spherical multipole transformation for MPFIT compatibility
  5. Psi4 integration via Psi4MBISGenerator

⚠️ Notes

  • MBIS charges are computed directly by Psi4 rather than fitted via MPFITObjective/MPFITSolver
  • The PR uses the existing MPFIT infrastructure after transforming MBIS multipoles to spherical harmonics
  • No separate MBIS-specific solver was needed since Psi4 provides the charges directly

Additional Enhancements:

  • Public API exports through pympfit/__init__.py
  • Documentation stubs for autogenerated API reference

Summary

This implementation enables users to benchmark MBIS vs. GDMA charges and leverage Psi4's native MBIS capabilities within the pympfit framework for high-throughput force field parameterization.

Shehan Parmar and others added 30 commits January 18, 2026 14:19
  - Add GDMASettings pydantic model
  - Add GDMAGenerator abstract base class
  - Jinja2 template for generating Psi4 input files
  - Add MPFITObjective and MPFITObjectiveTerm classes
  - Inherit from openff-recharge base classes
  - Add MPFITSolver base class
  - Add IterativeSolver, SciPySolver, MPFITSVDSolver implementations
  - Add generate_mpfit_charge_parameter function
  - Add molecule_to_mpfit_library_charge helper
  - Update mpfit __init__.py to export public API
  - Change imports from openff.recharge to openff_pympfit for MPFIT/GDMA modules
  - Keep openff-recharge imports for library charges and utilities
- adopted atomate2 ruff config
@shehan807
Copy link
Owner

Austin, excellent, this will be an awesome feature!! Two quick points

  1. could you add an example on how to generate MBIS charges somewhere in docs/tutorials? One option could be to add a "step 5" to the quick start tutorial that shows printed charges via similar/near identical python api as steps 1-4

  2. could you include MBIS to the test_pympfit test suite, at minimum, to the test_pympfit_single() test? this is a general regression test to ensure point charges reproduce the QM ESP to reasonable order. it should require a minimal modification to the parameterize decorator here by adding a tuple ("record_class, generator, solver") for the mbis implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants