Skip to main content

A Python package implementing the direct MaxFlux method and flat-bottom elastic network model for reaction path/transition state optimization.

Project description

PyDMF: A Python package for double-ended reaction path/transition state optimization

CI

Overview

This package provides a Python implementation of the direct MaxFlux (DMF) method and the flat-bottom elastic network model (FB-ENM). These tools offer a variational framework for reaction-path optimization and an efficient approach to generating physically plausible initial paths.

The software is intended for researchers who use ASE-compatible calculators and require either a method for obtaining near–transition-state structures without relying on second or higher energy derivatives, or a method for interpolating between two structures in a chemically plausible manner.

  • Compared with existing double-ended reaction-path optimization methods (e.g., NEB), DMF improves computational efficiency in terms of both the number of energy-evaluation points along the path and the number of optimization iterations.

  • Compared with existing initial-path generation approaches (e.g., IDPP), FB-ENM provides more energetically preferable paths with improved robustness.

Recent Updates

  • v1.2.0: GPU acceleration is now available, thanks to a contribution by @t-0hmura . See README_TORCH.md and PR #3 for details.

Requirements

Installation

We generally recommend installing this package via conda, as cyipopt is most reliably installed through conda.

conda create -n pydmf python=3.10
conda activate pydmf
conda install -c conda-forge ase cyipopt
pip install pydmf

If you prefer to install cyipopt without using conda, please follow its official installation guide. After installing cyipopt, you can install PyDMF via pip:

pip install pydmf

Example usage

Basic usage

PyDMF is used as part of an ASE script. For the basics of ASE, please refer to its official documentation. An example script is provided in sample/sample.py of PyDMF GitHub repository:

import numpy as np
from ase.io import write, read
from ase.calculators.emt import EMT
from dmf import DirectMaxFlux, interpolate_fbenm

# read react.xyz and prod.xyz
ref_images = [read('react.xyz'), read('prod.xyz')]

# generate initial path by FB-ENM
mxflx_fbenm = interpolate_fbenm(ref_images,correlated=True)

# write initial path and its coefficients
write('sample_ini.traj',mxflx_fbenm.images)
coefs = mxflx_fbenm.coefs.copy()
np.save('sample_ini_coefs',coefs)

# set up a variational problem of the direct MaxFlux method
mxflx = DirectMaxFlux(ref_images,coefs=coefs,nmove=3,update_teval=True)

# set up calculators
for image in mxflx.images:
    image.calc = EMT()

# solve the variational problem
mxflx.add_ipopt_options({'output_file':'sample_ipopt.out'})
mxflx.solve(tol='middle')

# write final path and history of x(tmax)
write('sample_fin.traj',mxflx.images)
write('sample_tmax.traj',mxflx.history.images_tmax)

You can run it simply by:

git clone https://github.com/shin1koda/dmf
cd dmf/sample
python sample.py

Running the script produces several output files, including:

  • sample_ini.traj: FB-ENM–interpolated path written in ASE trajectory format
  • sample_fin.traj: Optimized reaction path using the EMT potential
  • sample_tmax.traj: History of the estimated highest-energy point during optimization

Parallel energy/force evaluation

PyDMF supports parallel energy and force evaluations at the energy evaluation points along the path. See README_PARALLEL.md for details.

Documentation

For more details, please refer to the API documentation.

Citation

  1. S.-i. Koda and S. Saito, Locating Transition States by Variational Reaction Path Optimization with an Energy-Derivative-Free Objective Function, JCTC, 20, 2798–2811 (2024). doi: 10.1021/acs.jctc.3c01246
  2. S.-i. Koda and S. Saito, Flat-bottom Elastic Network Model for Generating Improved Plausible Reaction Paths, JCTC, 20, 7176−7187 (2024). doi: 10.1021/acs.jctc.4c00792
  3. S.-i. Koda and S. Saito, Correlated Flat-bottom Elastic Network Model for Improved Bond Rearrangement in Reaction Paths, JCTC, 21, 3513−3522 (2025). doi: 10.1021/acs.jctc.4c01549

Please cite:

  • Ref. 1 when you use the direct MaxFlux method
  • Ref. 2 when you use the flat-bottom elastic network model
  • Ref. 3 when you use the correlated flat-bottom elastic network model

Related works

PyDMF has been used in the following applications.

  • dmf-g16 (developed by our group): Wrapper software that enables DMF calculations with Gaussian and its native input formats. Paper & GitHub.

  • ColabReaction (developed by Karasawa et al.): Web-based application that integrates PyDMF and ML potential UMA. Application, paper, & GitHub.

Community guidelines

Contributing

Contributions to this project are welcome. If you would like to contribute new features, improvements, or documentation, please open a pull request on GitHub.
Before submitting a PR, we recommend opening a short issue to discuss the proposed change.

Reporting issues

If you encounter a problem, unexpected behavior, or a potential bug, please report it through the GitHub issue tracker:

https://github.com/shin1koda/dmf/issues

When reporting an issue, please include:

  • A clear description of the problem
  • Steps to reproduce the issue
  • Your environment (Python version, ASE version, cyipopt version, etc.)
  • Any relevant error messages or logs

Seeking support

If you have questions about the usage of the package, or need help integrating it into your workflow, feel free to open an issue labeled “question” on GitHub.
We will do our best to provide guidance based on availability.

License

This project is distributed under the MIT 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

pydmf-1.2.1.tar.gz (57.4 kB view details)

Uploaded Source

Built Distribution

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

pydmf-1.2.1-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

Details for the file pydmf-1.2.1.tar.gz.

File metadata

  • Download URL: pydmf-1.2.1.tar.gz
  • Upload date:
  • Size: 57.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydmf-1.2.1.tar.gz
Algorithm Hash digest
SHA256 76eedf57098fcdd9ba9316d9446b0ae462345fac8b52d41080f28f32d1fa102c
MD5 e545bc30cd0a63da2982d6b997de291e
BLAKE2b-256 24ef18897fa0d41f887526cac5257d253ee2052726f4dc431c4a79e8784d632e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydmf-1.2.1.tar.gz:

Publisher: publish.yml on shin1koda/dmf

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

File details

Details for the file pydmf-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: pydmf-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 56.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydmf-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 211d2ec78542f2ae300318d35aa0ebb1ebe572ac2d7e7d66a168a5fc27b92c23
MD5 245c111f58acf1aa5f1c7e75f6418edf
BLAKE2b-256 bd186811a58b49fff0ca7c6c1bd54546dbe739a70ae6a87ce74ac9a625370348

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydmf-1.2.1-py3-none-any.whl:

Publisher: publish.yml on shin1koda/dmf

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