This repo contains files for tutorial on P(GR)ACE and p(gr)acemaker
Supporting slides here
From dashboard (https://www.mahti.csc.fi/pun/sys/dashboard/)
-
Start Jupyter
- Partition: interactive
- Resources: Cores - 16
- Time: 4 hours
- Settings: Python - tensorflow
- Module version: tensorflow/2.15
- Jupyter type - lab
- Working directory: /user/[YOUR_USER_NAME]
-
Connect to Jupyter
git clone --depth 1 --branch feature/grace_fs https://github.com/ICAMS/python-ace.git
cd python-ace
pip install .
cd ..git clone --depth 1 https://github.com/ICAMS/grace-tensorpotential.git
cd grace-tensorpotential
pip install .
cd ..Documentation on pacemaker and installation instruction without GRACE https://pacemaker.readthedocs.io/en/latest/pacemaker/install/
git clone --depth 1 --branch grace https://github.com/yury-lysogorskiy/lammps.git
cd lammps/
mkdir build
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_MPI=ON -DPKG_ML-01-PACE=ON -DPKG_MC=ON -DPKG_MANYBODY=ON ../cmake
# Check that you have line `TensorFlow library is FOUND at ...` after previous command
cmake --build . -- -j
make install
cd ../..Path to the TensorFlow lib should be automatically set, but in case of problems try setting it manually
export LD_LIBRARY_PATH=/usr/local/lib64/python3.9/site-packages/tensorflow:$LD_LIBRARY_PATHgit clone https://github.com/AntBoc/pace-tutorial-2024.git
cd pace-tutorial-2024cd 01-PACE/00-AlLi-VASP-DATA
tar zxvf AlLi_vasp_data.tar.gz
cd AlLi_vasp_data
pace_collect --free-atom-energy auto --output-dataset-filename AlLi.pkl.gz
cd ../..Prepare the folder and copy the dataset
cd 01-AlLi-FIT
cp ../00-AlLi-VASP-DATA/AlLi.pkl.gz .and run automatic input file generation
pacemaker -tYou will see following requests and should reply:
Generating 'input.yaml'
Enter training dataset filename (ex.: data.pckl.gzip, [TAB] – autocompletion): AlLi.pkl.gz
Enter test set fraction or size (ex.: 0.05 or [ENTER] - no test set): 0.05
Please enter list of elements (ex.: "Cu", "AlNi", [ENTER] - determine from dataset): [ENTER]
Enter number of functions per element ([ENTER] - default 700): 300
Enter cutoff (Angstrom, default:7.0): 6.0
Enter weighting scheme type - `uniform` or `energy` ([ENTER] - `uniform`): energy
Input file is written into `input.yaml`
If you have input.yaml file in the current folder, then just execute:
pacemaker input.yamlAt the end you should find output_potential.yaml (if program terminates successfully) and interim_potential_0.yaml (always contains latest version of potential)
You can rename one of these files into AlLi.yaml
mv interim_potential_0.yaml AlLi.yamlIn order to compute active set, run
pace_activeset -d fitting_data_info.pckl.gzip AlLi.yamlGo to AlLi-LAMMPS folder and execute LAMMPS there
cd pace-tutorial-2024/02-AlLi-LAMMPS
lmp -in in.lammpsYou should see extrapolative_structures.dump file. If it is empty, then no extrapolation occurs. Also check c_max_pace_gamma column in log.lammps output.
Try to increase supercell size, change temperature profile, switch to NPT, change atom types to get extrapolative structures.
Remember, that LAMMPS will overwrite extrapolative_structures.dump file, so copy it beforehand.
pace_select -p AlLi.yaml -a AlLi.asi -e "Al Li" -m 20 -o selected/POSCAR extrapolative_structures.dumpIn case of problems with maxvolpy library, go to python-ace/lib/maxvolpy and try to run
pip install .Check the Jupyter notebook in python-ace/examples/active_learning/Active_Exploration.ipynb and adapt it for Al and/or Li and for your AlLi.yaml/asi potential
Check out the 01-PACE/pace_basic_validation.ipynb for basic manipulations with a trained model in python
cd 02-GRACE/01-HEA25-FS-FIT
gracemaker input.yaml -sf OR
after termination of gracemaker, run the following command to export model to LAMMPS format
gracemaker -r -s -sfIf a problem with yaml appers, run
pip install --upgrade pyyamlcd seed/1/
pace_activeset -d training_set.pkl.gz FS_model.yamlNow you can rename potential and active set files for using it in further examples:
mv FS_model.yaml HEA25_FS_model.yaml
mv FS_model.asi HEA25_FS_model.asiOR
We will use previously trained models available
cd 02-GRACE/02-HEA25-LAMMPS/10-elems-HEA25
orterun -n 2 --oversubscribe lmp -in in.lammps.extcd 02-GRACE/02-HEA25-LAMMPS/10-elems-mp-1layerDownload universal GRACE models
grace_downloadIdentify the path to the 1-LAYER model
grace_download | grep mp-1layercopy this path and inset into the in.lammps :
...
pair_style grace
pair_coeff * * /PATH/TO/HOME/.cache/grace/train_1.5M_test_75_grace_1layer_v2_7Aug2024 Ag Au Cu Ir Ni Pd Pt Rh Ru Sc
...
Run lammps WITHOUT mpi (on GPU, ideally):
lmp -in in.lammpsCheck out notebook 02-GRACE/02-HEA25-LAMMPS/Visualize_elemt_distrb.ipynb for visualization of the
elements distribution before and after the MDMC run.
ACE users support group
Pacemaker (and gracemaker soon) documentation
- Online documentation
- Bochkarev A., Lysogorskiy Y., and Drautz R. Graph Atomic Cluster Expansion for Semilocal Interactions beyond Equivariant Message Passing
- Lysogorskiy Y., Bochkarev A., Mrovec M., Drautz R., Active learning strategies for atomic cluster expansion models, Phys. Rev. Materials 7, 043801 (2023)
- Bochkarev, A., Lysogorskiy, Y., Menon, S., Qamar, M., Mrovec, M. and Drautz, R. Efficient parametrization of the atomic cluster expansion. Physical Review Materials 6(1) 013804 (2022)
- Lysogorskiy, Y., Oord, C. v. d., Bochkarev, A., Menon, S., Rinaldi, M., Hammerschmidt, T., Mrovec, M., Thompson, A., Csányi, G., Ortner, C. and Drautz, R. Performant implementation of the atomic cluster expansion (PACE) and application to copper and silicon. npj Computational Materials 7(1), 1-12 (2021)
- Drautz, R. Atomic cluster expansion for accurate and transferable interatomic potentials. Physical Review B, 99(1), 014104 (2019)
- HEA25 dataset: N. Lopanitsyna et al 2023 PRM 7(4) 045802 link
- HEA25S dataset: A. Mazitov et al 2024 J. Phys. Mater. 7 025007 link