https://pages.nist.gov/feasst
Project description
The Free Energy and Advanced Sampling Simulation Toolkit (FEASST) is a free and open-source software to conduct molecular- and particle-based simulations with Monte Carlo methods. New users can start with the website (DOI), manuscript, GitHub discussion and a five minute video. Support FEASST with a GitHub star or manuscript citation!
Quickstart
sudo apt install g++ cmake python3-venv # C++, CMake and Python3
python3 -m venv feasst; source ~/feasst/bin/activate # or use existing env/conda
CMAKE_BUILD_PARALLEL_LEVEL=8 pip3 install feasst # install
feasst-menu # interactive tutorial
For Mac/Linux use apt, yum, dnf, brew(homebrew), etc. For Windows, use WSL. For HPC, use “module avail/load.”
C++ Executable
Run with BASH/etc:
#!/bin/bash
num_particles=500
density=0.003
beta=`python3 -c "print(1./0.9)"`
length=`python3 -c "print(($num_particles/$density)**(1./3.))"`
tpc=1e4
feasst << EOF
# Comments begin with the # symbol.
# Compute average energy of LJ at T*=0.9, rho*=0.003
# See https://mmlapps.nist.gov/srs/LJ_PURE/mc.htm
MonteCarlo
RandomMT19937
#seed=1572362164
Configuration cubic_side_length=$length particle_type=lj:/feasst/particle/lj.txt
Potential Model=LennardJones VisitModel=VisitModelCell
Potential VisitModel=LongRangeCorrections
Checkpoint checkpoint_file=checkpoint.fst
ThermoParams beta=$beta chemical_potential=-1
Metropolis
TrialTranslate weight=1 tunable_param=2
Tune
CheckEnergy trials_per_update=$tpc decimal_places=8
Log trials_per_write=$tpc output_file=lj_eq.csv
Run until_num_particles=$num_particles particle_type=lj Trial=TrialAdd weight=2
Run num_trials=1e5
Remove name=Tune,Log
WriteCheckpoint
EOF
Restart with checkpoint.fst and BASH/etc:
#!/bin/bash
write="trials_per_write=1e4 output_file=lj"
feasst << EOF
Restart checkpoint_file=checkpoint.fst
Log $write.csv
Movie $write.xyz
Energy ${write}_en.csv
Metropolis trials_per_cycle=1e4 cycles_to_complete=1e2
Run until=complete
EOF
Run with script.txt and BASH/etc:
feasst < script.txt
Python Module
Install with BASH/etc:
sudo apt install g++ cmake python3-dev python3-venv
python3 -m venv feasst; source ~/feasst/bin/activate
CMAKE_BUILD_PARALLEL_LEVEL=8 CMAKE_ARGS="-DUSE_PYBIND11=ON" pip install feasst
Run in Python:
import numpy as np
import pandas as pd
import feasst
# Compare with T*=0.9,rho*=0.003 in https://mmlapps.nist.gov/srs/LJ_PURE/mc.htm.
num_particles=500
density=0.003
beta=1./0.9
length=np.power(num_particles/density, 1./3.)
prefix='lj'
write=f'trials_per_write=1e4 output_file={prefix}'
mc = feasst.MonteCarlo()
feasst.parse(mc, f"""RandomMT19937 seed=416974832
Configuration cubic_side_length={length} particle_type=lj:/feasst/particle/lj_new.txt
Potential Model=LennardJones VisitModel=VisitModelCell
ThermoParams beta={beta} chemical_potential=1
Metropolis
TrialTranslate tunable_param=2
Checkpoint checkpoint_file={prefix}_checkpoint.fst num_hours=1 num_hours_terminate=117.5667
CheckEnergy trials_per_update=1e4 decimal_places=8
Log {write}_eq.csv
Movie {write}_eq.xyz
Run until_num_particles={num_particles} Trial=TrialAdd particle_type=lj
Metropolis trials_per_cycle=1e4 cycles_to_complete=10
Run until=complete Stepper=Tune
Remove name=Log,Movie""")
print('# x-position of first particle/site.', mc.configuration(0).particle(0).site(0).position(0))
assert mc.configuration(0).particle(0).site(0).position(0) != 0.
feasst.parse(mc, f"""Metropolis trials_per_cycle=1e4 cycles_to_complete=1e2
Log {write}.csv
Movie {write}.xyz
Energy {write}_en.csv
CPUTime {write}_cpu.csv
ProfileCPU {write}_profile.csv
GhostTrialVolume {write}_pressure.csv trials_per_update=1e4
Run until=complete""")
print('# compare average energy with SRSW https://mmlapps.nist.gov/srs/LJ_PURE/mc.htm.')
en = pd.read_csv('lj_en.csv')
print('<U> =', en['average'][0]/num_particles, '+/-', en['block_stdev'][0]/num_particles)
Documentation
See https://pages.nist.gov/feasst. View documentation for your specific version by downloading FEASST and opening the html/index.html file as shown by the following Bash commands.
curl -OL https://github.com/usnistgov/feasst/archive/refs/tags/v0.25.19.tar.gz
tar -xf v0.25.19.tar.gz
open feasst-0.25.19/html/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file feasst-0.25.19.tar.gz.
File metadata
- Download URL: feasst-0.25.19.tar.gz
- Upload date:
- Size: 6.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
215f63f933a9009751611eeddd13616f518c269b74d5fe42c889c7501fdfecb0
|
|
| MD5 |
ced39ea2a8fbdf0a81d095724e27891e
|
|
| BLAKE2b-256 |
df70e6d086b1d066977432cc7a4b98512d961cbd5e4725d8aa578a1e3d79b9fb
|