Skip to main content

Quantum-guided molecular mechanics force field optimization

Project description

Q2MM

Quantum-guided molecular mechanics force field optimization.

CI PyPI Python

Q2MM optimizes molecular mechanics (MM) force field parameters by minimizing the difference between MM-calculated properties and quantum mechanics (QM) reference data. It is designed for building transition state force fields (TSFFs) that enable rapid virtual screening of enantioselective catalysts.

📖 Documentation

Why Q2MM?

  • Hessian-informed initialization — the Seminario method extracts bond and angle force constants directly from QM Hessians, providing excellent starting parameters before optimization begins.
  • Open-source backends — first-class support for OpenMM and Psi4 alongside commercial packages (Gaussian, Schrödinger, Tinker).
  • Clean, modular architecture — format-agnostic data models (ForceField, Q2MMMolecule) decouple algorithms from file formats.
  • Modern optimization — powered by scipy.optimize with L-BFGS-B, Nelder-Mead, trust-region, and Levenberg-Marquardt methods.
  • Transition state support — negative force constants, torsion parameters, and proper eigenvalue handling for saddle-point geometries.

Quick Start

pip install "q2mm[openmm,optimize]"   # OpenMM backend + scipy optimizer

Pre-release: the current version is an alpha. Add --pre to any install command (e.g. pip install --pre "q2mm[openmm,optimize]") if a stable release hasn't been published yet.

For development, clone the repo and install in editable mode:

pip install -e ".[dev]"
from q2mm.optimizers.objective import ReferenceData, ObjectiveFunction
from q2mm.optimizers.scipy_opt import ScipyOptimizer
from q2mm.models.seminario import estimate_force_constants
from q2mm.backends.mm import OpenMMEngine

# 1. Load QM reference data and molecule from a Gaussian checkpoint
ref, mol = ReferenceData.from_fchk("ts-optimized.fchk", bond_tolerance=1.4)

# 2. Estimate initial force field from the QM Hessian (Seminario method)
ff = estimate_force_constants(mol, au_hessian=True)

# 3. Set up the objective function and optimize
engine = OpenMMEngine()
obj = ObjectiveFunction(ff, engine, [mol], ref)
result = ScipyOptimizer(method="L-BFGS-B").optimize(obj)

print(result.summary())

ReferenceData.from_fchk() auto-extracts bond lengths and angles from the QM geometry. You can also use from_gaussian() for .log files, or from_molecule() for maximum control. See the Tutorial for the full workflow including frequencies, eigenmatrix data, and multi-molecule fits.

Supported Backends

Backend Type License
OpenMM MM MIT
Psi4 QM BSD-3
Tinker MM Free (academic)
Gaussian QM Commercial
Schrödinger QM/MM Commercial

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

q2mm-5.0.0a2.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

q2mm-5.0.0a2-py3-none-any.whl (135.9 kB view details)

Uploaded Python 3

File details

Details for the file q2mm-5.0.0a2.tar.gz.

File metadata

  • Download URL: q2mm-5.0.0a2.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for q2mm-5.0.0a2.tar.gz
Algorithm Hash digest
SHA256 cef8d0868b1a7bddbfe9691606ba33b7a1d812cad615d1e6050acc31b76b487a
MD5 5c771067728a0d0a46602e888ea4dda9
BLAKE2b-256 12e4f832f825f06407cb426bcf5407cd4bed5c9c90b3fba7a347ceeb569c2535

See more details on using hashes here.

Provenance

The following attestation bundles were made for q2mm-5.0.0a2.tar.gz:

Publisher: publish.yml on ericchansen/q2mm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file q2mm-5.0.0a2-py3-none-any.whl.

File metadata

  • Download URL: q2mm-5.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 135.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for q2mm-5.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 23c5f4a5272b87a36bbc4076505b074c393af5a3158956277549cf6b32b361c2
MD5 3342eb5415f6d98b0e985365c7300830
BLAKE2b-256 fef45cea84efb38bd5c082a9f34dc91d2c93fd3f7dd2cad2807eac2b43d2ce33

See more details on using hashes here.

Provenance

The following attestation bundles were made for q2mm-5.0.0a2-py3-none-any.whl:

Publisher: publish.yml on ericchansen/q2mm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page