https://github.com/liugaoyong/pygfnff
Python wrapper for GFN-FF based on F2PY. https://pypi.org/project/pygfnff
https://github.com/liugaoyong/pygfnff
ase atomic-simulation-environment chemistry gfn-ff molecule python single-point-energy xtb
Last synced: 17 days ago
JSON representation
Python wrapper for GFN-FF based on F2PY. https://pypi.org/project/pygfnff
- Host: GitHub
- URL: https://github.com/liugaoyong/pygfnff
- Owner: LiuGaoyong
- License: gpl-3.0
- Created: 2025-07-23T01:42:05.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-15T07:00:21.000Z (10 months ago)
- Last Synced: 2025-08-15T08:32:18.063Z (10 months ago)
- Topics: ase, atomic-simulation-environment, chemistry, gfn-ff, molecule, python, single-point-energy, xtb
- Language: Fortran
- Homepage:
- Size: 799 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyGFNFF
[](https://pypi.org/project/pygfnff/)
[](https://pepy.tech/projects/pygfnff)
This is a Python version for [GFN-FF](https://github.com/pprcht/gfnff) based on F2PY.
---
## Usage
There is an `ase.Calculator` subclass termed `GFNFF` for non-PBC system. And a more low function called `gfnff` can be found in [the code](https://github.com/LiuGaoyong/PyGFNFF/blob/main/pygfnff/_pygfnff.py).
```python
from ase import Atoms
from ase.build import molecule
from ase.optimize import BFGS
from scipy.spatial.distance import pdist
from pygfnff import GFNFF
atoms = Atoms(molecule("CO"), calculator=GFNFF())
opt = BFGS(atoms, logfile="-", trajectory=None)
opt.run(fmax=0.03, steps=50)
e = atoms.get_potential_energy()
print(f"Energy: {atoms.get_potential_energy():.3f}eV")
print(f"C=O Length: {pdist(atoms.positions).item():.3f}\u212b")
# Output:
# Step Time Energy fmax
# BFGS: 0 19:56:53 -9.188347 2.478131
# BFGS: 1 19:56:53 -9.050233 7.166941
# BFGS: 2 19:56:53 -9.215231 0.433918
# BFGS: 3 19:56:53 -9.215990 0.070653
# BFGS: 4 19:56:53 -9.216011 0.000889
# Energy: -9.216eV
# C=O Length: 1.129Å
```
### Reference
1. S.Spicher, S.Grimme. Robust Atomistic Modeling of Materials, Organometallic, and Biochemical Systems (2020), DOI: https://doi.org/10.1002/anie.202004239
2. A standalone library of the GFN-FF method. https://github.com/pprcht/gfnff/