FFPOPT Quick Start Guide - Installation
Learning objectives
Install FFPOPT in a dedicated conda environment using the supported pip workflow.
Configure required prerequisites for the FFPOPT activities (AMBER, Python environment, and optional PySCF-NEO support).
Use either the Amarel module setup or a local installation pathway to prepare a working FFPOPT environment.
Relevant literature
Coming Soon!
Activities
In this activity, we will be using a small molecular fragment that contains a deprotonated amide. These fragments can show up in certain ligands, and are presently a challenge for standard force field generation within amber. We will walk through how to use FFPOPT to scan dihedral angles with both MD force-fields and machine learning potentials, and then we will walk through the process of fitting new dihedral parameters.
Installation
To run this activity, you will need to have FFPOPT installed. You can find the installation instructions in the FFPOPT GitLab repository: FFPOPT GitLab <git@gitlab.com:RutgersLBSR/ffpopt.git>.
Installation instructions may be found in the readme file. You will also need to have AMBER installed, as well as Python 3.7+ with the numpy and scipy libraries.
Important
Amarel Users - Good News! FFPOPT is already installed on Amarel. You can load it using the following command:
module purge module use /projectsp/f_lbsr/YorkGroup/software/23jun25/modulefiles # One of these two lines, depending on the ML potential you want to use #module load 23jun25/ffpopt/21aug25.g-pytorch #module load 23jun25/ffpopt/21aug25.g-psi4
To install FFPOPT on your local machine, you can use the following commands.
First, we need to download the git repository from GitLab.
git clone git@gitlab.com:RutgersLBSR/ffpopt.git
Then, we can navigate into the ffpopt directory and will use the instructions from the README to install the package using pip.
Warning
It is best to consult the README for the most up-to-date installation instructions, as they may change over time. The following is a general guide, but be sure to check the README for any updates or changes.
Note
The following instructions assume you have miniforge installed. If you don’t you can install it as:
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
Note - to ensure that the installation process goes smoothly, we create separate conda environments for the PyTorch and TensorFlow versions of FFPOPT. You can choose to install one or both, depending on your needs.
cd ffpopt
mamba env create --yes -n ffpopt-pytorch -f environment.yml
mamba env create --yes -n ffpopt-tensorflow -f environment.yml
Now that the environments are created, we can activate the one we want to use and install FFPOPT using pip.
# For PyTorch version
conda activate ffpopt-pytorch
ACADEMIC=TRUE python3 -m pip install --group pytorch --extra-index-url https://download.pytorch.org/whl/cu121 .
# For TensorFlow version
conda activate ffpopt-tensorflow
ACADEMIC=TRUE python3 -m pip install --group tensorflow --extra-index-url https://download.pytorch.org/whl/cu121 .
Warning
For non-academic users, you will need to set the ACADEMIC environment variable to FALSE. You can do this by running the following command before installing FFPOPT:
To use PySCF-NEO for nuclear quantum effects, you will need to install PySCF with the NEO module. You can do this by running the following command (suggested in a different directory, as it is a separate package):
git clone https://github.com/theorychemyang/pyscf.git
cd pyscf
cd pyscf/lib
mkdir build
cd build
cmake ..
make
export PYTHONPATH=/path/to/pyscf:$PYTHONPATH
If you want this to be available every time you open a terminal, you can modify the activate.d script in your conda environment to set the PYTHONPATH variable. You can do this by creating a file called ffpopt_pyscf.sh in the etc/conda/activate.d directory of your conda environment with the following content:
export BACKUP_PYTHONPATH=$PYTHONPATH
export PYTHONPATH=/path/to/pyscf:$PYTHONPATH
and then creating a file called ffpopt_pyscf.sh in the etc/conda/deactivate.d directory of your conda environment with the following content:
export PYTHONPATH=$BACKUP_PYTHONPATH
unset BACKUP_PYTHONPATH
Hint
To find the path to your conda environment, you can run the following command:
conda env list
This will show you a list of all your conda environments and their paths. You can then navigate to the appropriate environment and create the activate.d and deactivate.d directories if they don’t already exist, and add the ffpopt_pyscf.sh files as described above.
This will ensure that the PySCF package is available in your conda environment whenever you activate it, and will cleanly remove it from your PYTHONPATH when you deactivate the environment.