Machine Learning for Accurate Force Calculations in Molecular Dynamics Simulation
The cython package needs to be built once before they can be used. To do this, go to the folder located inside the cython_files
folder and execute the command given in command_to_build.txt
.
cd cython_files/pbc_adjustment;
python setup.py build_ext --inplace
cd -;
Using a fresh virtual environment using an environment manager like Conda is highly recommended before installing the python packages. Run conda env create -f environment.yml
if using conda to get an environment with the required packages installed. Additionally you may need to configure CUDA on your setup in order for tensorflow to use the GPU.
python simulation.py --mode=classical --save_traj_at_end=False --write_pos_only=True --also_save_npz=True
python simulation.py --mode=classical-and-predictor --model_folder=saved_weights/weights --save_traj_at_end=False --write_pos_only=True --also_save_npz=True
--model_folder
: Folder containing the saved weights--mode
: Eitherclassical
orclassical-and-predictor
. Specifies whether a classical only simulation or a classical + model forces simulation is to be run.--save_traj_at_end
: Eithertrue
orfalse
. Setting this to true will save the whole trajectory at the end, while storing it in the RAM while the simulation is being run. Setting this to false will flush the trajectory at regular intervals from the RAM to disk. This should be set to false for large systems or longer trajectories as the whole trajctory might not fit in RAM.--write_pos_only
: Eithertrue
orfalse
. If true, only the positions trajectory is saved. If false, positions, velocities and forces will be saved.--also_save_npz
: Eithertrue
orfalse
. If true, also saves all traj files as npz at the end(converts the .xyz files to npz). If false, just xyz files are saved. npz files are written at the end, so they wont be written partially if the simulation crashes.