Skip to content

VoicuTomut/ase-fast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25,804 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ASE-fast — Atomic Simulation Environment (accelerated)

https://gitlab.com/ase/ase/-/raw/master/doc/static/ase256.png

ASE-fast is a drop-in replacement for ASE with optional Rust-accelerated hot paths. No code changes required — install the Rust extensions and every compatible call is automatically routed to the fast path.

Measured speedups on Apple M-series (arm64, Python 3.13):

Operation Speedup
Neighbor list (scalar cutoff) 13.6×
Neighbor list (per-atom radii) 12.2×
Neighbor list (dict cutoffs) 9.1×
VASP POSCAR write 6.3×
VASP POSCAR read 3.3×
Extended XYZ write (large atoms) 3.5×
Simple XYZ write 2.3×
Minkowski reduction 2.6×

ASE is a set of tools and Python modules for setting up, manipulating, running, visualizing and analyzing atomistic simulations.

Upstream webpage: https://ase-lib.org/

Requirements

Optional:

  • Flask (for ase.db web-interface)
  • spglib (for symmetry operations)
  • Rust toolchain (auto-compiled on install — see below)

Installation

From PyPI (recommended):

pip install ase-fast

The Rust extensions compile automatically during install. You need a Rust toolchain installed first (one-time, takes ~1 min):

  • Linux / macOS: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Windows: download and run rustup-init.exe

If no Rust toolchain is found, pip install ase-fast falls back gracefully to pure-Python mode — identical behaviour to upstream ASE, no errors.

Development install from source:

git clone https://github.com/VoicuTomut/ase-fast.git
cd ase-fast
pip install -e .

To verify the Rust extensions are active after install:

python -c "
import ase.neighborlist as nl
import ase.io.extxyz as ex
import ase.geometry.minkowski_reduction as mk
import ase.io.vasp as vasp
print('NL Rust:      ', nl._HAVE_RUST_NEIGHBORLIST)
print('extxyz Rust:  ', ex._HAVE_RUST_EXTXYZ)
print('geometry Rust:', mk._HAVE_RUST_GEOM)
print('VASP IO Rust: ', vasp._HAVE_RUST_IO)
"

Running benchmarks:

python benchmarks/compare.py           # speed comparison table
python benchmarks/compare.py --reps 3  # faster run

Testing

Please run the tests:

$ ase test  # takes 1 min.

and send us the output if there are failing tests.

Contact

Feel free to create Merge Requests and Issues on our GitLab page: https://gitlab.com/ase/ase

For regular support, please use the mailing list or chat rather than GitLab.

Example

Geometry optimization of hydrogen molecule with NWChem:

>>> from ase import Atoms
>>> from ase.optimize import BFGS
>>> from ase.calculators.nwchem import NWChem
>>> from ase.io import write
>>> h2 = Atoms('H2',
               positions=[[0, 0, 0],
                          [0, 0, 0.7]])
>>> h2.calc = NWChem(xc='PBE')
>>> opt = BFGS(h2, trajectory='h2.traj')
>>> opt.run(fmax=0.02)
BFGS:   0  19:10:49    -31.435229     2.2691
BFGS:   1  19:10:50    -31.490773     0.3740
BFGS:   2  19:10:50    -31.492791     0.0630
BFGS:   3  19:10:51    -31.492848     0.0023
>>> write('H2.xyz', h2)
>>> h2.get_potential_energy()  # ASE's units are eV and Ang
-31.492847800329216

This example requires NWChem to be installed.

$ ase gui h2.traj

Contributors

  • Original ASE team (DTU Physics and many others) — see upstream AUTHORS file
  • Andrei Voicu Tomut — Rust acceleration layer (ase-fast), type hints, error messages, LLM builder

About

ASE with Rust hot paths — 12× faster neighbor lists, 6× faster VASP IO, 3.5× faster extxyz. Drop-in: pip install ase-fast

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
GPL-2.0
COPYING
LGPL-2.1
COPYING.LESSER

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages