FlexSim: A Python Package for simulations of water adsorption within MOFs considering the framework flexibility
This code including three main parts,
- the simulations of water adsorption within MOFs,
- the workflow for DFT-label.
- the workflow for MLP training, especially the active learning.
Because the development of machine learing potential is fast, the versions of MACE and pytorch should be update according to the version of MACE you used. And update the calculator object in the code. Here, we use python=3.12, torch=2.5.1 and mace_torch=3.12.0. The detailed installation tutorial is shown below.
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124
pip install mace_torch If you have further question, please refer the official document of pytorch and mace.
All python scripts can be found in the cli folder. The examples to use these scripts can be found in the example folder. The explaination of each parameters can be found by this command below (the same for other scripts)
python init_sample.py --helppython -u init_sample.py \
--cif="$cif_file" \
--run_md \
--num_to_geo_opt=100 \
--md_steps=10000 \
--run_sample \
--sort_sample \
--num_to_sample=100 \
--modelpath="mace-medium-density-agnesi-stress.model" \
--sample_test \
--num_to_sample_test=50 \
--suffix='0508' \
--cueq \python -u activelearn.py \
--cif="$cif_file" \
--autosample_gas \ #For the pristine MOFs, --autosample
--totalnumber=14000 \
--sort_sample \
--number_of_gas=3 \
--suffix='0508' \For this workflow, you only need copy the folder to your computer and provide a confs folder including all cif files you need to calculate. When you move this workflow to your computer, please ensure process.py works and ordered_job.srun stasifiies the requirement of slurm system in your computer. In order to achieve the best acceleration performance, you should sort the structures by similarity defined by the distance in the SOAP descriptor space. You can do it by the scripts in "MLP training".
python -u henry_flex.py python -u heat.py \
--cif="$cif_file" \
--run_md \
--md_steps=1000000 \
--modelpath="MACE_run-5555.model" \
--suffix='0508' \
--cueq \
--temperature_list="[300]" \Example to run single H2O at 300 Kelvin in order to calculate ensemble average energy, which can be found in example folder. You need to add a "MACE.model" file into this folder.
python -u run_mc.py