├── .gitignore ├── LICENSE ├── README.md ├── cov.xml ├── docs ├── Makefile ├── build │ ├── .buildinfo │ ├── .doctrees │ │ ├── api │ │ │ ├── index.doctree │ │ │ ├── loaders.doctree │ │ │ ├── maths.doctree │ │ │ ├── models │ │ │ │ ├── ace.doctree │ │ │ │ ├── gap.doctree │ │ │ │ ├── index.doctree │ │ │ │ └── snap.doctree │ │ │ └── optimisers.doctree │ │ ├── environment.pickle │ │ ├── examples.doctree │ │ ├── faq.doctree │ │ ├── index.doctree │ │ ├── nbsphinx │ │ │ └── notebooks │ │ │ │ └── ace_optimise.ipynb │ │ ├── notebooks │ │ │ └── ace_optimise.doctree │ │ └── quickstart.doctree │ ├── _sources │ │ ├── api │ │ │ ├── index.rst.txt │ │ │ ├── loaders.rst.txt │ │ │ ├── maths.rst.txt │ │ │ ├── models │ │ │ │ ├── ace.rst.txt │ │ │ │ ├── gap.rst.txt │ │ │ │ ├── index.rst.txt │ │ │ │ └── snap.rst.txt │ │ │ └── optimisers.rst.txt │ │ ├── examples.rst.txt │ │ ├── faq.rst.txt │ │ ├── index.rst.txt │ │ ├── notebooks │ │ │ └── ace_optimise.ipynb.txt │ │ └── quickstart.rst.txt │ ├── _static │ │ ├── basic.css │ │ ├── debug.css │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── file.png │ │ ├── language_data.js │ │ ├── minus.png │ │ ├── nbsphinx-broken-thumbnail.svg │ │ ├── nbsphinx-code-cells.css │ │ ├── nbsphinx-gallery.css │ │ ├── nbsphinx-no-thumbnail.svg │ │ ├── plus.png │ │ ├── pygments.css │ │ ├── scripts │ │ │ ├── furo-extensions.js │ │ │ ├── furo.js │ │ │ ├── furo.js.LICENSE.txt │ │ │ └── furo.js.map │ │ ├── searchtools.js │ │ ├── skeleton.css │ │ ├── sphinx_highlight.js │ │ └── styles │ │ │ ├── furo-extensions.css │ │ │ ├── furo-extensions.css.map │ │ │ ├── furo.css │ │ │ └── furo.css.map │ ├── api │ │ ├── index.html │ │ ├── loaders.html │ │ ├── maths.html │ │ ├── models │ │ │ ├── ace.html │ │ │ ├── gap.html │ │ │ ├── index.html │ │ │ └── snap.html │ │ └── optimisers.html │ ├── examples.html │ ├── faq.html │ ├── genindex.html │ ├── html │ │ ├── .buildinfo │ │ ├── .doctrees │ │ │ ├── api │ │ │ │ ├── index.doctree │ │ │ │ ├── loaders.doctree │ │ │ │ ├── maths.doctree │ │ │ │ ├── models │ │ │ │ │ ├── ace.doctree │ │ │ │ │ ├── gap.doctree │ │ │ │ │ ├── index.doctree │ │ │ │ │ └── snap.doctree │ │ │ │ └── optimisers.doctree │ │ │ ├── environment.pickle │ │ │ ├── examples.doctree │ │ │ ├── faq.doctree │ │ │ ├── index.doctree │ │ │ ├── nbsphinx │ │ │ │ └── notebooks │ │ │ │ │ └── ace_optimise.ipynb │ │ │ ├── notebooks │ │ │ │ └── ace_optimise.doctree │ │ │ └── quickstart.doctree │ │ ├── _sources │ │ │ ├── api │ │ │ │ ├── index.rst.txt │ │ │ │ ├── loaders.rst.txt │ │ │ │ ├── maths.rst.txt │ │ │ │ ├── models │ │ │ │ │ ├── ace.rst.txt │ │ │ │ │ ├── gap.rst.txt │ │ │ │ │ ├── index.rst.txt │ │ │ │ │ └── snap.rst.txt │ │ │ │ └── optimisers.rst.txt │ │ │ ├── examples.rst.txt │ │ │ ├── faq.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── notebooks │ │ │ │ └── ace_optimise.ipynb.txt │ │ │ └── quickstart.rst.txt │ │ ├── _static │ │ │ ├── basic.css │ │ │ ├── debug.css │ │ │ ├── doctools.js │ │ │ ├── documentation_options.js │ │ │ ├── file.png │ │ │ ├── language_data.js │ │ │ ├── minus.png │ │ │ ├── nbsphinx-broken-thumbnail.svg │ │ │ ├── nbsphinx-code-cells.css │ │ │ ├── nbsphinx-gallery.css │ │ │ ├── nbsphinx-no-thumbnail.svg │ │ │ ├── plus.png │ │ │ ├── pygments.css │ │ │ ├── scripts │ │ │ │ ├── furo-extensions.js │ │ │ │ ├── furo.js │ │ │ │ ├── furo.js.LICENSE.txt │ │ │ │ └── furo.js.map │ │ │ ├── searchtools.js │ │ │ ├── skeleton.css │ │ │ ├── sphinx_highlight.js │ │ │ ├── styles │ │ │ │ ├── furo-extensions.css │ │ │ │ ├── furo-extensions.css.map │ │ │ │ ├── furo.css │ │ │ │ └── furo.css.map │ │ │ └── xpot-logo.png │ │ ├── api │ │ │ ├── index.html │ │ │ ├── loaders.html │ │ │ ├── maths.html │ │ │ ├── models │ │ │ │ ├── ace.html │ │ │ │ ├── gap.html │ │ │ │ ├── index.html │ │ │ │ └── snap.html │ │ │ └── optimisers.html │ │ ├── examples.html │ │ ├── faq.html │ │ ├── genindex.html │ │ ├── index.html │ │ ├── notebooks │ │ │ ├── ace_optimise.html │ │ │ └── ace_optimise.ipynb │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── quickstart.html │ │ ├── search.html │ │ └── searchindex.js │ ├── index.html │ ├── notebooks │ │ ├── ace_optimise.html │ │ └── ace_optimise.ipynb │ ├── objects.inv │ ├── py-modindex.html │ ├── quickstart.html │ ├── search.html │ └── searchindex.js ├── make.bat └── source │ ├── api │ ├── index.rst │ ├── loaders.rst │ ├── maths.rst │ ├── models │ │ ├── ace.rst │ │ ├── gap.rst │ │ ├── index.rst │ │ └── snap.rst │ └── optimisers.rst │ ├── conf.py │ ├── examples.rst │ ├── faq.rst │ ├── index.rst │ ├── notebooks │ └── ace_optimise.ipynb │ └── quickstart.rst ├── examples ├── ace_input.hjson ├── ace_optimise.ipynb ├── ace_optimise.py ├── gap_C_XYZ │ ├── bulk_cryst_train.xyz │ ├── bulk_cryst_train.xyz.idx │ └── suft_amo_test.xyz ├── gap_input.hjson ├── gap_optimise.ipynb ├── opt_ACE │ └── test_ace │ │ ├── 1 │ │ ├── cycle_metrics.txt │ │ ├── fitting_data_info.pckl.gzip │ │ ├── log.txt │ │ ├── metrics.txt │ │ ├── target_potential.yaml │ │ ├── test_cycle_metrics.txt │ │ ├── test_data_info.pckl.gzip │ │ ├── test_ef-distributions.png │ │ ├── test_ladder_metrics.txt │ │ ├── test_metrics.txt │ │ ├── train_ef-distributions.png │ │ └── xpot-ace.yaml │ │ ├── atomistic_errors.csv │ │ ├── loss_function_errors.csv │ │ └── parameters.csv ├── opt_GAP │ └── test_GAP │ │ ├── 1 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_51_35_3621 │ │ ├── 2 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_52_25_5321 │ │ ├── 3 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_52_53_5031 │ │ ├── 4 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_53_49_1601 │ │ ├── 5 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_54_36_3531 │ │ ├── 6 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_55_17_2831 │ │ ├── 7 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_55_42_1511 │ │ ├── 8 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_56_8_4181 │ │ ├── 9 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_56_36_5271 │ │ ├── 10 │ │ ├── gap.xml │ │ └── gap.xml.sparseX.GAP_2024_2_15_0_11_57_6_4491 │ │ ├── atomistic_errors.csv │ │ ├── atomistic_errors_final │ │ ├── loss_function_errors.csv │ │ ├── loss_function_errors_final │ │ ├── parameters.csv │ │ └── parameters_final ├── snap-optimization │ ├── py-xpot.py │ └── snap_input_updated.hjson ├── snap_input.hjson ├── snap_optimise.ipynb ├── snap_optimise.py └── xpot-v1.2 │ ├── ace_input.hjson │ ├── ace_optimise.ipynb │ ├── gap_input.hjson │ ├── gap_optimise.ipynb │ ├── snap_input.hjson │ ├── snap_optimise.ipynb │ └── snap_optimise.py ├── images └── xpot-logo.png ├── paper-data ├── JCP-2023 │ ├── C-GAP-17 │ │ ├── SNAP │ │ │ ├── j3_l_gap17.hjson │ │ │ ├── j4_l_gap17.hjson │ │ │ ├── j5_l_gap17.hjson │ │ │ └── j6_l_gap17.hjson │ │ ├── qSNAP │ │ │ ├── j3_q_gap17.hjson │ │ │ ├── j4_q_gap17.hjson │ │ │ ├── j5_q_gap17.hjson │ │ │ └── j6_q_gap17_var_cut.hjson │ │ └── test-set-opt │ │ │ ├── best_j5_md.in │ │ │ ├── best_j5_orig.in │ │ │ ├── best_j5_rand.in │ │ │ ├── in_C_q_j5_md.hjson │ │ │ ├── in_C_q_j5_orig_test.hjson │ │ │ ├── in_C_q_j5_random.hjson │ │ │ └── test_sets │ │ │ ├── high_t_md_test.xyz │ │ │ └── test_random_spheres.xyz │ └── Zuo_2020 │ │ ├── cu │ │ └── in_cu_q_j6.hjson │ │ ├── ge │ │ └── in_ge_q_j6.hjson │ │ ├── li │ │ └── in_li_q_j6.hjson │ │ ├── mo │ │ └── in_mo_q_j6.hjson │ │ ├── ni │ │ └── in_ni_q_j6.hjson │ │ ├── py-xpot.py │ │ └── si │ │ └── in_si_q_j8.hjson └── JCTC-2024 │ ├── Sb2Te3 │ ├── Sb2Te3-900.hjson │ └── XPOT-Sb2Te3.yace │ └── Si │ ├── XPOT-ACE-1.hjson │ ├── XPOT-ACE-2.hjson │ ├── XPOT-ACE-3.hjson │ ├── XPOT-ACE-4.hjson │ └── XPOT-Si.yace ├── pyproject.toml ├── src ├── .DS_Store ├── README.md └── xpot │ ├── __init__.py │ ├── convert.py │ ├── graphing.py │ ├── loaders.py │ ├── maths.py │ ├── models │ ├── __init__.py │ ├── ace.py │ ├── defaults │ │ ├── ace_defaults.json │ │ ├── gap_defaults.json │ │ ├── grace_defaults.json │ │ ├── mace_defaults.json │ │ ├── nequip_defaults.json │ │ └── snap_defaults.json │ ├── gap.py │ ├── model.py │ └── snap.py │ ├── optimiser.py │ ├── testing.ipynb │ └── workflows.py └── tests ├── inputs ├── defaults.json ├── hypers.hjson ├── mace-test.xyz ├── mace-train.xyz ├── nequip-train.xyz ├── nequip-train.xyz.idx ├── test-test.xyz ├── test-test.xyz.idx ├── test-test.xyz.pkl.gzip ├── test.xyz ├── test.xyz.pkl.gzip ├── test.xyz.pkl.gzip.xyz ├── train-test.xyz ├── train-test.xyz.idx └── train-test.xyz.pkl.gzip ├── mock_runs ├── atomistic_errors.csv ├── loss_function_errors.csv ├── parameters.csv └── test_models │ ├── ace-input.hjson │ ├── gap-input.hjson │ ├── mace-input.hjson │ ├── nequip-input.hjson │ └── snap-input.hjson ├── test_convert.py ├── test_loaders.py ├── test_maths.py ├── test_models.py ├── test_optimiser.py └── test_workflows.py /.gitignore: -------------------------------------------------------------------------------- 1 | **/__pycache__/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![xpot-logo](images/xpot-logo.png) 2 | 3 | # XPOT: Cross-Platform Hyperparameter Optimizer for Machine Learning Potentials 4 | 5 | This software package provides an interface to machine learning (ML) potential fitting methods and allows for the automated optimization of relevant hyperparameters. 6 | 7 | The software is described in a [paper in the Special Machine learning edition of JCP](https://pubs.aip.org/aip/jcp/article/159/2/024803/2901815). Please cite this paper when using XPOT in your research. 8 | 9 | ### Installation Instructions 10 | 11 | Only compatible with `python >= 3.10`. Older python version may work, but have not been tested. 12 | 13 | ``` 14 | git clone https://github.com/dft-dutoit/XPOT.git 15 | cd xpot 16 | pip install --upgrade . 17 | ``` 18 | 19 | After this - you must install pacemaker, gap_fit, and/or fitSNAP yourself, for fitting to work properly. 20 | 21 | Required Python Packages: 22 | - LAMMPS python interface 23 | - scikit-optimize 24 | - numpy 25 | - hjson 26 | - pandas 27 | - matplotlib 28 | - ase 29 | - tabulate 30 | - quippy-ase >=0.9.0 (GAP potentials only) 31 | - FitSNAP (SNAP potentials only) https://fitsnap.github.io/ 32 | - pacemaker (ACE potentials only) https://pacemaker.readthedocs.io/ 33 | 34 | ### Usage 35 | 36 | To use XPOT, please check out the example notebooks & python files included in the examples folder. These examples give walkthroughs for using the code. The documentation can be compiled and viewed with sphinx. In the near future, the documentation will be hosted online and linked here. 37 | 38 | ### Original Data for JCP 2023 Paper 39 | 40 | The current files are updated to be compatible with the latest version of XPOT. The original files for the JCP 2023 paper can be found in the v1.0.0 XPOT-2023 release. -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/build/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: ac0ad2b927c8ca7df1c240271703fba9 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/build/.doctrees/api/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/index.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/loaders.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/loaders.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/maths.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/maths.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/models/ace.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/models/ace.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/models/gap.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/models/gap.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/models/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/models/index.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/models/snap.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/models/snap.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/api/optimisers.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/api/optimisers.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/.doctrees/examples.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/examples.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/faq.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/faq.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/notebooks/ace_optimise.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/notebooks/ace_optimise.doctree -------------------------------------------------------------------------------- /docs/build/.doctrees/quickstart.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/.doctrees/quickstart.doctree -------------------------------------------------------------------------------- /docs/build/_sources/api/index.rst.txt: -------------------------------------------------------------------------------- 1 | API 2 | === 3 | 4 | This section provides a full API reference for XPOT. 5 | 6 | .. toctree:: 7 | :titlesonly: 8 | 9 | models/index 10 | optimisers 11 | loaders 12 | maths -------------------------------------------------------------------------------- /docs/build/_sources/api/loaders.rst.txt: -------------------------------------------------------------------------------- 1 | Loaders 2 | ======= 3 | 4 | This module contains the various functions used to load and manipulate 5 | data and information agnostic to the model class used. These functions are used 6 | in all classes, and can be called if creating your own model class. 7 | 8 | .. automodule:: xpot.loaders 9 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/api/maths.rst.txt: -------------------------------------------------------------------------------- 1 | Maths 2 | ===== 3 | 4 | Mathematical functions for manipulating error outputs dependent on parameters 5 | selected. 6 | 7 | .. automodule:: xpot.maths 8 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/api/models/ace.rst.txt: -------------------------------------------------------------------------------- 1 | ACE 2 | === 3 | 4 | .. autoclass:: xpot.models.PACE 5 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/api/models/gap.rst.txt: -------------------------------------------------------------------------------- 1 | GAP 2 | === 3 | 4 | .. autoclass:: xpot.models.GAP 5 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/api/models/index.rst.txt: -------------------------------------------------------------------------------- 1 | Models 2 | ====== 3 | 4 | Documentation for each of the models used in XPOT. Each 5 | class has the same base functionality which can be described as follows: 6 | 7 | #. Read input file, sort into optimisable and unoptimisable hyperparameters. 8 | #. Export optimisable hyperparameters to the optimiser. 9 | #. Read optimiser output and write model fitting input. 10 | #. Fit the model. 11 | #. Collect validation errors from the model. 12 | #. Pass the output to the optimiser object and write output files. 13 | 14 | .. toctree:: 15 | :titlesonly: 16 | 17 | ace 18 | snap 19 | gap -------------------------------------------------------------------------------- /docs/build/_sources/api/models/snap.rst.txt: -------------------------------------------------------------------------------- 1 | SNAP 2 | ==== 3 | 4 | .. autoclass:: xpot.models.SNAP 5 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/api/optimisers.rst.txt: -------------------------------------------------------------------------------- 1 | Optimisers 2 | ========== 3 | 4 | The optimiser module contains the :code:`NamedOptimiser` class which is used 5 | for optimisation of model hyperparameters. This module is used for all model 6 | types and thus in order to create custom model classes, outputs from the model 7 | must be compatible with the requirements of the :code:`NamedOptimiser` class. 8 | 9 | .. automodule:: xpot.optimiser 10 | :members: -------------------------------------------------------------------------------- /docs/build/_sources/examples.rst.txt: -------------------------------------------------------------------------------- 1 | Optimisation Examples 2 | ===================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Example Notebooks: 7 | 8 | notebooks/ace_optimise -------------------------------------------------------------------------------- /docs/build/_sources/faq.rst.txt: -------------------------------------------------------------------------------- 1 | FAQ 2 | ==== 3 | 4 | **What fitting methods are included in XPOT?** 5 | 6 | ACE, SNAP, and GAP potentials are currently implemented in XPOT. Development for expansion to other methods will follow. 7 | 8 | **What are the best practices for using XPOT?** 9 | 10 | XPOT users are recommended to start with pilot runs, to check the hardware limitations of their system, before starting an optimization sweep. XPOT works best with robust testing sets, to accurately measure the extrapolative performance of the potentials fitted. 11 | 12 | Users are required to make sure that the parameter space that they optimize over is within the limitations of their hardware. Optimizing convergence parameters over large ranges often results in the most expensive parameters being chosen during optimization. 13 | 14 | The more constrained the search space is, the fewer iterations are *normally* required to reach a stage with diminishing returns. 15 | 16 | Several generalised functions are provided for ease of use (conversion between dataset types, extraction of the best potential etc.). 17 | 18 | **How parallelisable is XPOT?** 19 | 20 | Currently, a single optimization run occurs "serially". Each fit can be parallelised dependent on the fitting method, but XPOT itself does not support asynchronous optimization. This is a priority and currently in development for future versions. 21 | 22 | **Is XPOT compatible with multi-objective optimization?** 23 | 24 | Currently, XPOT does not have multi-objective optimization included. In general, we suggest that users select convergence hyperparameters manually, and then optimize the hyperparameters that do not significantly affect the resource cost. 25 | 26 | In the future, we aim to include multi-objective optimization in XPOT. 27 | 28 | **What** :math:`{\alpha}` **value should I use?** 29 | 30 | We recommend either performing a sweep of :math:`{\alpha}` values, or selecting the alpha value based on desired energy and force loss values. By comparing these values, you can find a good :math:`{\alpha}` for your system. -------------------------------------------------------------------------------- /docs/build/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. XPOT documentation master file, created by 2 | sphinx-quickstart on Tue Feb 6 15:55:30 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | XPOT Documentation 7 | ================================ 8 | 9 | **XPOT** is a Python package for automated optimisation of hyperparameters when 10 | fitting machine learning potentials for chemistry. 11 | 12 | This documentation is a work in progress, and will be updated as the package is 13 | developed. 14 | 15 | .. note:: 16 | XPOT currently supports ACE, SNAP, and GAP potentials, and work continues on 17 | adding support for other potentials. 18 | 19 | .. toctree:: 20 | :maxdepth: 2 21 | :caption: Contents: 22 | 23 | quickstart 24 | faq 25 | examples 26 | api/index 27 | 28 | 29 | 30 | Indices and tables 31 | ================== 32 | 33 | * :ref:`genindex` 34 | * :ref:`modindex` 35 | * :ref:`search` 36 | -------------------------------------------------------------------------------- /docs/build/_sources/quickstart.rst.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Standalone Installation 5 | ----------------------- 6 | 7 | For installation, the :code:`pip` package manager is recommended: 8 | 9 | .. code-block:: console 10 | 11 | $ pip install xpot 12 | 13 | Due to the fact that :code:`xpot` is a wrapper around various ML potential fitting 14 | codes, you will need to install the fitting packages relevant for you. 15 | 16 | Currently supported fitting codes: 17 | - `pacemaker `_ 18 | - `FitSNAP `_ 19 | - `GAP `_ 20 | 21 | In order to fit potentials using any of these codes, you will need to install 22 | them in the same environment as :code:`xpot`. All other dependencise will be 23 | installed automatically with :code:`xpot`. 24 | 25 | In order to test whether xpot has installed, you can run the following 26 | code in a python shell: 27 | 28 | .. code-block:: python 29 | 30 | from xpot.loaders import load_defaults 31 | from xpot.maths import get_rmse 32 | 33 | defaults = load_defaults("/path/to/any/valid/json") 34 | print(defaults) 35 | test_list = [5, 5, 4] 36 | print(get_rmse(test_list)) 37 | 38 | If the installation was successful, you should see the json file printed to 39 | console, as well as a return of 22 for the RMSE. To test the fitting codes, you 40 | will first need to install them, and then run the relevant jupyter notebooks 41 | included in the :code:`xpot` repository. 42 | 43 | ACE Functionality 44 | ----------------- 45 | 46 | For ACE functionality, you need to install :code:`pacemaker`. The package (and 47 | installation steps) are available at `this link 48 | `_. The 49 | installation steps can be completed either before or after pip installation of 50 | :code:`xpot`. 51 | 52 | .. warning:: 53 | In our experience, it is required to run: :code:`pip install protobuf==3.20.*` 54 | 55 | after installation of :code:`pacemaker`. 56 | 57 | SNAP Functionality 58 | ------------------ 59 | SNAP functionality is provided by the :code:`fitsnap` package. The package (and 60 | installation steps) are available at `this link 61 | `_. If not installing via :code:`pip` 62 | you must use the following: :code:`export PYTHONPATH=/path/to/fitsnap:PYTHONPATH` 63 | 64 | SNAP functionality also requires :code:`LAMMPS` to be installed. It must be 65 | compiled with ML_SNAP and PYTHON packages enabled. Steps are laid out in the 66 | :code:`fitsnap` documentation, but also at the `LAMMPS website 67 | `_. 68 | 69 | GAP Functionality 70 | ----------------- 71 | 72 | GAP functionality is provided by :code:`QUIP`. The package (and installation 73 | steps) are available at `this link `_. 74 | -------------------------------------------------------------------------------- /docs/build/_static/debug.css: -------------------------------------------------------------------------------- 1 | /* 2 | This CSS file should be overridden by the theme authors. It's 3 | meant for debugging and developing the skeleton that this theme provides. 4 | */ 5 | body { 6 | font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, 7 | "Apple Color Emoji", "Segoe UI Emoji"; 8 | background: lavender; 9 | } 10 | .sb-announcement { 11 | background: rgb(131, 131, 131); 12 | } 13 | .sb-announcement__inner { 14 | background: black; 15 | color: white; 16 | } 17 | .sb-header { 18 | background: lightskyblue; 19 | } 20 | .sb-header__inner { 21 | background: royalblue; 22 | color: white; 23 | } 24 | .sb-header-secondary { 25 | background: lightcyan; 26 | } 27 | .sb-header-secondary__inner { 28 | background: cornflowerblue; 29 | color: white; 30 | } 31 | .sb-sidebar-primary { 32 | background: lightgreen; 33 | } 34 | .sb-main { 35 | background: blanchedalmond; 36 | } 37 | .sb-main__inner { 38 | background: antiquewhite; 39 | } 40 | .sb-header-article { 41 | background: lightsteelblue; 42 | } 43 | .sb-article-container { 44 | background: snow; 45 | } 46 | .sb-article-main { 47 | background: white; 48 | } 49 | .sb-footer-article { 50 | background: lightpink; 51 | } 52 | .sb-sidebar-secondary { 53 | background: lightgoldenrodyellow; 54 | } 55 | .sb-footer-content { 56 | background: plum; 57 | } 58 | .sb-footer-content__inner { 59 | background: palevioletred; 60 | } 61 | .sb-footer { 62 | background: pink; 63 | } 64 | .sb-footer__inner { 65 | background: salmon; 66 | } 67 | .sb-article { 68 | background: white; 69 | } 70 | -------------------------------------------------------------------------------- /docs/build/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '1.1', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /docs/build/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/_static/file.png -------------------------------------------------------------------------------- /docs/build/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/_static/minus.png -------------------------------------------------------------------------------- /docs/build/_static/nbsphinx-gallery.css: -------------------------------------------------------------------------------- 1 | .nbsphinx-gallery { 2 | display: grid; 3 | grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 4 | gap: 5px; 5 | margin-top: 1em; 6 | margin-bottom: 1em; 7 | } 8 | 9 | .nbsphinx-gallery > a { 10 | padding: 5px; 11 | border: 1px dotted currentColor; 12 | border-radius: 2px; 13 | text-align: center; 14 | } 15 | 16 | .nbsphinx-gallery > a:hover { 17 | border-style: solid; 18 | } 19 | 20 | .nbsphinx-gallery img { 21 | max-width: 100%; 22 | max-height: 100%; 23 | } 24 | 25 | .nbsphinx-gallery > a > div:first-child { 26 | display: flex; 27 | align-items: start; 28 | justify-content: center; 29 | height: 120px; 30 | margin-bottom: 5px; 31 | } 32 | -------------------------------------------------------------------------------- /docs/build/_static/nbsphinx-no-thumbnail.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/build/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/_static/plus.png -------------------------------------------------------------------------------- /docs/build/_static/scripts/furo-extensions.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/_static/scripts/furo-extensions.js -------------------------------------------------------------------------------- /docs/build/_static/scripts/furo.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * gumshoejs v5.1.2 (patched by @pradyunsg) 3 | * A simple, framework-agnostic scrollspy script. 4 | * (c) 2019 Chris Ferdinandi 5 | * MIT License 6 | * http://github.com/cferdinandi/gumshoe 7 | */ 8 | -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 1a79d5e1bd092638a5a743ac6611bb59 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/index.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/loaders.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/loaders.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/maths.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/maths.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/models/ace.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/models/ace.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/models/gap.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/models/gap.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/models/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/models/index.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/models/snap.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/models/snap.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/api/optimisers.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/api/optimisers.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/html/.doctrees/examples.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/examples.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/faq.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/faq.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/notebooks/ace_optimise.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/notebooks/ace_optimise.doctree -------------------------------------------------------------------------------- /docs/build/html/.doctrees/quickstart.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/.doctrees/quickstart.doctree -------------------------------------------------------------------------------- /docs/build/html/_sources/api/index.rst.txt: -------------------------------------------------------------------------------- 1 | API 2 | === 3 | 4 | This section provides a full API reference for XPOT. 5 | 6 | .. toctree:: 7 | :titlesonly: 8 | 9 | models/index 10 | workflows 11 | optimiser 12 | loaders 13 | convert 14 | maths -------------------------------------------------------------------------------- /docs/build/html/_sources/api/loaders.rst.txt: -------------------------------------------------------------------------------- 1 | Loaders 2 | ======= 3 | 4 | This module contains the various functions used to load and manipulate 5 | data and information agnostic to the model class used. These functions are used 6 | in all classes, and can be called if creating your own model class. 7 | 8 | .. automodule:: xpot.loaders 9 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/api/maths.rst.txt: -------------------------------------------------------------------------------- 1 | Maths 2 | ===== 3 | 4 | Mathematical functions for manipulating error outputs dependent on parameters 5 | selected. 6 | 7 | .. automodule:: xpot.maths 8 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/api/models/ace.rst.txt: -------------------------------------------------------------------------------- 1 | ACE 2 | === 3 | 4 | .. autoclass:: xpot.models.PACE 5 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/api/models/gap.rst.txt: -------------------------------------------------------------------------------- 1 | GAP 2 | === 3 | 4 | .. autoclass:: xpot.models.GAP 5 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/api/models/index.rst.txt: -------------------------------------------------------------------------------- 1 | Models 2 | ====== 3 | 4 | Documentation for each of the models used in XPOT. Each 5 | class has the same base functionality which can be described as follows: 6 | 7 | #. Read input file, sort into optimisable and unoptimisable hyperparameters. 8 | #. Export optimisable hyperparameters to the optimiser. 9 | #. Read optimiser output and write model fitting input. 10 | #. Fit the model. 11 | #. Collect validation errors from the model. 12 | #. Pass the output to the optimiser object and write output files. 13 | 14 | .. toctree:: 15 | :titlesonly: 16 | 17 | ace 18 | snap 19 | gap -------------------------------------------------------------------------------- /docs/build/html/_sources/api/models/snap.rst.txt: -------------------------------------------------------------------------------- 1 | SNAP 2 | ==== 3 | 4 | .. autoclass:: xpot.models.SNAP 5 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/api/optimisers.rst.txt: -------------------------------------------------------------------------------- 1 | Optimisers 2 | ========== 3 | 4 | The optimiser module contains the :code:`NamedOptimiser` class which is used 5 | for optimisation of model hyperparameters. This module is used for all model 6 | types and thus in order to create custom model classes, outputs from the model 7 | must be compatible with the requirements of the :code:`NamedOptimiser` class. 8 | 9 | .. automodule:: xpot.optimiser 10 | :members: -------------------------------------------------------------------------------- /docs/build/html/_sources/examples.rst.txt: -------------------------------------------------------------------------------- 1 | Optimisation Examples 2 | ===================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Example Notebooks: 7 | 8 | notebooks/ace_optimise -------------------------------------------------------------------------------- /docs/build/html/_sources/faq.rst.txt: -------------------------------------------------------------------------------- 1 | FAQ 2 | ==== 3 | 4 | **What fitting methods are included in XPOT?** 5 | 6 | ACE, SNAP, and GAP potentials are currently implemented in XPOT. Development of inclusion for GNNs is underway. 7 | 8 | **What are the best practices for using XPOT?** 9 | 10 | XPOT users are recommended to start with pilot runs, to check the hardware limitations of their system, before starting an optimization sweep. XPOT works best with robust testing sets, to accurately measure the extrapolative performance of the potentials fitted. 11 | 12 | Users are required to make sure that the parameter space that they optimize over is within the limitations of their hardware. Optimizing convergence parameters over large ranges often results in the most expensive parameters being chosen during optimization. 13 | 14 | The more constrained the search space is, the fewer iterations are *normally* required to reach a stage with diminishing returns. 15 | 16 | Several generalised functions are provided for ease of use (conversion between dataset types, extraction of the best potential etc.). 17 | 18 | **Generating Datasets for Optimization** 19 | 20 | Some ML potentials benefit from different things in datasets. For example, GAP potentials are often fit with dimer data in the dataset, while other methods (such as ACE) may perform better when this data is excluded. It is worth noting that dimer data can skew the `cutoff` hyperparameter if it is optimized. This is because the dimer data will go out to a distance that is often significantly longer than the interactions in the rest of the (bulk) dataset. As such, we recommend not including dimer data in fitting unless you are aware of this effect, and alter the dimer data included *for optimization* to end at the minimum cutoff distance allowed in optimization. 21 | 22 | Additionally, we recommend that users can optimize their potentials on smaller datasets which are representative of their large final datasets. This can significantly reduce the time required for optimization. However, the complexity of the potential will often need to be reduced for smaller datasets, and this should be taken into account when optimization is undertaken. 23 | 24 | **How parallelisable is XPOT?** 25 | 26 | Currently, a single optimization run occurs "serially". Each fit can be parallelised dependent on the fitting method, but XPOT itself does not support asynchronous optimization. This is a priority and currently in development for future versions. 27 | 28 | **Is XPOT compatible with multi-objective optimization?** 29 | 30 | Currently, XPOT does not have multi-objective optimization included. In general, we suggest that users select convergence hyperparameters manually, and then optimize the hyperparameters that do not significantly affect the resource cost. 31 | 32 | In the future, we aim to include multi-objective optimization in XPOT. 33 | 34 | **What** :math:`{\alpha}` **value should I use?** 35 | 36 | We recommend either performing a sweep of :math:`{\alpha}` values, or selecting the alpha value based on desired energy and force loss values. By comparing these values, you can find a good :math:`{\alpha}` for your system. -------------------------------------------------------------------------------- /docs/build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. XPOT documentation master file, created by 2 | sphinx-quickstart on Tue Feb 6 15:55:30 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | XPOT Documentation 7 | ================================ 8 | 9 | **XPOT** is a Python package for automated optimisation of hyperparameters when 10 | fitting machine learning potentials for chemistry. 11 | 12 | This documentation is a work in progress, and will be updated as the package is developed over time. 13 | 14 | .. note:: 15 | XPOT currently supports ACE (via `pacemaker`), SNAP (via `fitSNAP3`), and GAP (via `gap_fit`)potentials, and work continues on 16 | adding support for GNN potentials. 17 | 18 | .. toctree:: 19 | :maxdepth: 2 20 | :caption: Contents: 21 | 22 | quickstart 23 | faq 24 | examples 25 | api/index 26 | 27 | 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /docs/build/html/_sources/quickstart.rst.txt: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Standalone Installation 5 | ----------------------- 6 | 7 | For installation, the :code:`pip` package manager is recommended: 8 | 9 | .. code-block:: console 10 | 11 | $ pip install xpot 12 | 13 | Due to the fact that :code:`xpot` is a wrapper around various ML potential fitting 14 | codes, you will need to install the fitting packages relevant for you. 15 | 16 | Currently supported fitting codes: 17 | - `pacemaker `_ 18 | - `FitSNAP `_ 19 | - `GAP `_ 20 | 21 | In order to fit potentials using any of these codes, you will need to install 22 | them in the same environment as :code:`xpot`. All other dependencise will be 23 | installed automatically with :code:`xpot`. 24 | 25 | In order to test whether xpot has installed, you can run the following 26 | code in a python shell: 27 | 28 | .. code-block:: python 29 | 30 | from xpot.loaders import load_defaults 31 | from xpot.maths import get_rmse 32 | 33 | defaults = load_defaults("/path/to/any/valid/json") 34 | print(defaults) 35 | test_list = [5, 5, 4] 36 | print(get_rmse(test_list)) 37 | 38 | If the installation was successful, you should see the json file printed to 39 | console, as well as a return of 22 for the RMSE. To test the fitting codes, you 40 | will first need to install them, and then run the relevant jupyter notebooks 41 | included in the :code:`xpot` repository. 42 | 43 | ACE Functionality 44 | ----------------- 45 | 46 | For ACE functionality, you need to install :code:`pacemaker`. The package (and 47 | installation steps) are available at `this link 48 | `_. The 49 | installation steps can be completed either before or after pip installation of 50 | :code:`xpot`. 51 | 52 | .. warning:: 53 | In our experience, it is required to run: :code:`pip install protobuf==3.20.*` 54 | 55 | after installation of :code:`pacemaker`. 56 | 57 | SNAP Functionality 58 | ------------------ 59 | SNAP functionality is provided by the :code:`fitsnap` package. The package (and 60 | installation steps) are available at `this link 61 | `_. If not installing via :code:`pip` 62 | you must use the following: :code:`export PYTHONPATH=/path/to/fitsnap:PYTHONPATH` 63 | 64 | SNAP functionality also requires :code:`LAMMPS` to be installed. It must be 65 | compiled with ML_SNAP and PYTHON packages enabled. Steps are laid out in the 66 | :code:`fitsnap` documentation, but also at the `LAMMPS website 67 | `_. 68 | 69 | GAP Functionality 70 | ----------------- 71 | 72 | GAP functionality is provided by :code:`QUIP`. The package (and installation 73 | steps) are available at `this link `_. 74 | -------------------------------------------------------------------------------- /docs/build/html/_static/debug.css: -------------------------------------------------------------------------------- 1 | /* 2 | This CSS file should be overridden by the theme authors. It's 3 | meant for debugging and developing the skeleton that this theme provides. 4 | */ 5 | body { 6 | font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, 7 | "Apple Color Emoji", "Segoe UI Emoji"; 8 | background: lavender; 9 | } 10 | .sb-announcement { 11 | background: rgb(131, 131, 131); 12 | } 13 | .sb-announcement__inner { 14 | background: black; 15 | color: white; 16 | } 17 | .sb-header { 18 | background: lightskyblue; 19 | } 20 | .sb-header__inner { 21 | background: royalblue; 22 | color: white; 23 | } 24 | .sb-header-secondary { 25 | background: lightcyan; 26 | } 27 | .sb-header-secondary__inner { 28 | background: cornflowerblue; 29 | color: white; 30 | } 31 | .sb-sidebar-primary { 32 | background: lightgreen; 33 | } 34 | .sb-main { 35 | background: blanchedalmond; 36 | } 37 | .sb-main__inner { 38 | background: antiquewhite; 39 | } 40 | .sb-header-article { 41 | background: lightsteelblue; 42 | } 43 | .sb-article-container { 44 | background: snow; 45 | } 46 | .sb-article-main { 47 | background: white; 48 | } 49 | .sb-footer-article { 50 | background: lightpink; 51 | } 52 | .sb-sidebar-secondary { 53 | background: lightgoldenrodyellow; 54 | } 55 | .sb-footer-content { 56 | background: plum; 57 | } 58 | .sb-footer-content__inner { 59 | background: palevioletred; 60 | } 61 | .sb-footer { 62 | background: pink; 63 | } 64 | .sb-footer__inner { 65 | background: salmon; 66 | } 67 | .sb-article { 68 | background: white; 69 | } 70 | -------------------------------------------------------------------------------- /docs/build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '1.1', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/nbsphinx-gallery.css: -------------------------------------------------------------------------------- 1 | .nbsphinx-gallery { 2 | display: grid; 3 | grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 4 | gap: 5px; 5 | margin-top: 1em; 6 | margin-bottom: 1em; 7 | } 8 | 9 | .nbsphinx-gallery > a { 10 | padding: 5px; 11 | border: 1px dotted currentColor; 12 | border-radius: 2px; 13 | text-align: center; 14 | } 15 | 16 | .nbsphinx-gallery > a:hover { 17 | border-style: solid; 18 | } 19 | 20 | .nbsphinx-gallery img { 21 | max-width: 100%; 22 | max-height: 100%; 23 | } 24 | 25 | .nbsphinx-gallery > a > div:first-child { 26 | display: flex; 27 | align-items: start; 28 | justify-content: center; 29 | height: 120px; 30 | margin-bottom: 5px; 31 | } 32 | -------------------------------------------------------------------------------- /docs/build/html/_static/nbsphinx-no-thumbnail.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/build/html/_static/scripts/furo-extensions.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/_static/scripts/furo-extensions.js -------------------------------------------------------------------------------- /docs/build/html/_static/scripts/furo.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * gumshoejs v5.1.2 (patched by @pradyunsg) 3 | * A simple, framework-agnostic scrollspy script. 4 | * (c) 2019 Chris Ferdinandi 5 | * MIT License 6 | * http://github.com/cferdinandi/gumshoe 7 | */ 8 | -------------------------------------------------------------------------------- /docs/build/html/_static/xpot-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/_static/xpot-logo.png -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/html/objects.inv -------------------------------------------------------------------------------- /docs/build/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/docs/build/objects.inv -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/api/index.rst: -------------------------------------------------------------------------------- 1 | API 2 | === 3 | 4 | This section provides a full API reference for XPOT. 5 | 6 | .. toctree:: 7 | :titlesonly: 8 | 9 | models/index 10 | workflows 11 | optimiser 12 | loaders 13 | convert 14 | maths -------------------------------------------------------------------------------- /docs/source/api/loaders.rst: -------------------------------------------------------------------------------- 1 | Loaders 2 | ======= 3 | 4 | This module contains the various functions used to load and manipulate 5 | data and information agnostic to the model class used. These functions are used 6 | in all classes, and can be called if creating your own model class. 7 | 8 | .. automodule:: xpot.loaders 9 | :members: -------------------------------------------------------------------------------- /docs/source/api/maths.rst: -------------------------------------------------------------------------------- 1 | Maths 2 | ===== 3 | 4 | Mathematical functions for manipulating error outputs dependent on parameters 5 | selected. 6 | 7 | .. automodule:: xpot.maths 8 | :members: -------------------------------------------------------------------------------- /docs/source/api/models/ace.rst: -------------------------------------------------------------------------------- 1 | ACE 2 | === 3 | 4 | .. autoclass:: xpot.models.PACE 5 | :members: -------------------------------------------------------------------------------- /docs/source/api/models/gap.rst: -------------------------------------------------------------------------------- 1 | GAP 2 | === 3 | 4 | .. autoclass:: xpot.models.GAP 5 | :members: -------------------------------------------------------------------------------- /docs/source/api/models/index.rst: -------------------------------------------------------------------------------- 1 | Models 2 | ====== 3 | 4 | Documentation for each of the models used in XPOT. Each 5 | class has the same base functionality which can be described as follows: 6 | 7 | #. Read input file, sort into optimisable and unoptimisable hyperparameters. 8 | #. Export optimisable hyperparameters to the optimiser. 9 | #. Read optimiser output and write model fitting input. 10 | #. Fit the model. 11 | #. Collect validation errors from the model. 12 | #. Pass the output to the optimiser object and write output files. 13 | 14 | .. toctree:: 15 | :titlesonly: 16 | 17 | ace 18 | snap 19 | gap -------------------------------------------------------------------------------- /docs/source/api/models/snap.rst: -------------------------------------------------------------------------------- 1 | SNAP 2 | ==== 3 | 4 | .. autoclass:: xpot.models.SNAP 5 | :members: -------------------------------------------------------------------------------- /docs/source/api/optimisers.rst: -------------------------------------------------------------------------------- 1 | Optimisers 2 | ========== 3 | 4 | The optimiser module contains the :code:`NamedOptimiser` class which is used 5 | for optimisation of model hyperparameters. This module is used for all model 6 | types and thus in order to create custom model classes, outputs from the model 7 | must be compatible with the requirements of the :code:`NamedOptimiser` class. 8 | 9 | .. automodule:: xpot.optimiser 10 | :members: -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | # -- Project information ----------------------------------------------------- 7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 8 | 9 | project = "XPOT" 10 | copyright = "2024, D. F. Thomas du Toit" 11 | author = "D. F. Thomas du Toit" 12 | release = "1.1" 13 | 14 | # -- General configuration --------------------------------------------------- 15 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 16 | 17 | extensions = [ 18 | "sphinx.ext.duration", 19 | "sphinx.ext.autodoc", 20 | "sphinx.ext.autosummary", 21 | "nbsphinx", 22 | "sphinx.ext.mathjax", 23 | "sphinx.ext.napoleon", 24 | "sphinx.ext.intersphinx", 25 | # "sphinxext.opengraph", 26 | # "sphinx_copybutton", 27 | ] 28 | 29 | intersphinx_mapping = dict() 30 | intersphinx_mapping["python"] = ("https://docs.python.org/3", None) 31 | intersphinx_mapping["numpy"] = ("https://numpy.org/doc/stable/", None) 32 | intersphinx_mapping["skopt"] = ( 33 | "https://scikit-optimize.github.io/stable/", 34 | None, 35 | ) 36 | intersphinx_mapping["pandas"] = ( 37 | "https://pandas.pydata.org/pandas-docs/stable/", 38 | None, 39 | ) 40 | 41 | nbsphinx_execute = "never" 42 | 43 | templates_path = ["_templates"] 44 | exclude_patterns = [] 45 | 46 | 47 | # -- Options for HTML output ------------------------------------------------- 48 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 49 | 50 | html_theme = "furo" 51 | html_static_path = ["_static"] 52 | html_logo = "../../images/xpot-logo.png" 53 | html_theme_options = { 54 | "logo_only": True, 55 | "display_version": False, 56 | } 57 | -------------------------------------------------------------------------------- /docs/source/examples.rst: -------------------------------------------------------------------------------- 1 | Optimisation Examples 2 | ===================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Example Notebooks: 7 | 8 | notebooks/ace_optimise -------------------------------------------------------------------------------- /docs/source/faq.rst: -------------------------------------------------------------------------------- 1 | FAQ 2 | ==== 3 | 4 | **What fitting methods are included in XPOT?** 5 | 6 | ACE, SNAP, and GAP potentials are currently implemented in XPOT. Development of inclusion for GNNs is underway. 7 | 8 | **What are the best practices for using XPOT?** 9 | 10 | XPOT users are recommended to start with pilot runs, to check the hardware limitations of their system, before starting an optimization sweep. XPOT works best with robust testing sets, to accurately measure the extrapolative performance of the potentials fitted. 11 | 12 | Users are required to make sure that the parameter space that they optimize over is within the limitations of their hardware. Optimizing convergence parameters over large ranges often results in the most expensive parameters being chosen during optimization. 13 | 14 | The more constrained the search space is, the fewer iterations are *normally* required to reach a stage with diminishing returns. 15 | 16 | Several generalised functions are provided for ease of use (conversion between dataset types, extraction of the best potential etc.). 17 | 18 | **Generating Datasets for Optimization** 19 | 20 | Some ML potentials benefit from different things in datasets. For example, GAP potentials are often fit with dimer data in the dataset, while other methods (such as ACE) may perform better when this data is excluded. It is worth noting that dimer data can skew the `cutoff` hyperparameter if it is optimized. This is because the dimer data will go out to a distance that is often significantly longer than the interactions in the rest of the (bulk) dataset. As such, we recommend not including dimer data in fitting unless you are aware of this effect, and alter the dimer data included *for optimization* to end at the minimum cutoff distance allowed in optimization. 21 | 22 | Additionally, we recommend that users can optimize their potentials on smaller datasets which are representative of their large final datasets. This can significantly reduce the time required for optimization. However, the complexity of the potential will often need to be reduced for smaller datasets, and this should be taken into account when optimization is undertaken. 23 | 24 | **How parallelisable is XPOT?** 25 | 26 | Currently, a single optimization run occurs "serially". Each fit can be parallelised dependent on the fitting method, but XPOT itself does not support asynchronous optimization. This is a priority and currently in development for future versions. 27 | 28 | **Is XPOT compatible with multi-objective optimization?** 29 | 30 | Currently, XPOT does not have multi-objective optimization included. In general, we suggest that users select convergence hyperparameters manually, and then optimize the hyperparameters that do not significantly affect the resource cost. 31 | 32 | In the future, we aim to include multi-objective optimization in XPOT. 33 | 34 | **What** :math:`{\alpha}` **value should I use?** 35 | 36 | We recommend either performing a sweep of :math:`{\alpha}` values, or selecting the alpha value based on desired energy and force loss values. By comparing these values, you can find a good :math:`{\alpha}` for your system. -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. XPOT documentation master file, created by 2 | sphinx-quickstart on Tue Feb 6 15:55:30 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | XPOT Documentation 7 | ================================ 8 | 9 | **XPOT** is a Python package for automated optimisation of hyperparameters when 10 | fitting machine learning potentials for chemistry. 11 | 12 | This documentation is a work in progress, and will be updated as the package is developed over time. 13 | 14 | .. note:: 15 | XPOT currently supports ACE (via `pacemaker`), SNAP (via `fitSNAP3`), and GAP (via `gap_fit`)potentials, and work continues on 16 | adding support for GNN potentials. 17 | 18 | .. toctree:: 19 | :maxdepth: 2 20 | :caption: Contents: 21 | 22 | quickstart 23 | faq 24 | examples 25 | api/index 26 | 27 | 28 | 29 | Indices and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /docs/source/quickstart.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | Standalone Installation 5 | ----------------------- 6 | 7 | For installation, the :code:`pip` package manager is recommended: 8 | 9 | .. code-block:: console 10 | 11 | $ pip install xpot 12 | 13 | Due to the fact that :code:`xpot` is a wrapper around various ML potential fitting 14 | codes, you will need to install the fitting packages relevant for you. 15 | 16 | Currently supported fitting codes: 17 | - `pacemaker `_ 18 | - `FitSNAP `_ 19 | - `GAP `_ 20 | 21 | In order to fit potentials using any of these codes, you will need to install 22 | them in the same environment as :code:`xpot`. All other dependencise will be 23 | installed automatically with :code:`xpot`. 24 | 25 | In order to test whether xpot has installed, you can run the following 26 | code in a python shell: 27 | 28 | .. code-block:: python 29 | 30 | from xpot.loaders import load_defaults 31 | from xpot.maths import get_rmse 32 | 33 | defaults = load_defaults("/path/to/any/valid/json") 34 | print(defaults) 35 | test_list = [5, 5, 4] 36 | print(get_rmse(test_list)) 37 | 38 | If the installation was successful, you should see the json file printed to 39 | console, as well as a return of 22 for the RMSE. To test the fitting codes, you 40 | will first need to install them, and then run the relevant jupyter notebooks 41 | included in the :code:`xpot` repository. 42 | 43 | ACE Functionality 44 | ----------------- 45 | 46 | For ACE functionality, you need to install :code:`pacemaker`. The package (and 47 | installation steps) are available at `this link 48 | `_. The 49 | installation steps can be completed either before or after pip installation of 50 | :code:`xpot`. 51 | 52 | .. warning:: 53 | In our experience, it is required to run: :code:`pip install protobuf==3.20.*` 54 | 55 | after installation of :code:`pacemaker`. 56 | 57 | SNAP Functionality 58 | ------------------ 59 | SNAP functionality is provided by the :code:`fitsnap` package. The package (and 60 | installation steps) are available at `this link 61 | `_. If not installing via :code:`pip` 62 | you must use the following: :code:`export PYTHONPATH=/path/to/fitsnap:PYTHONPATH` 63 | 64 | SNAP functionality also requires :code:`LAMMPS` to be installed. It must be 65 | compiled with ML_SNAP and PYTHON packages enabled. Steps are laid out in the 66 | :code:`fitsnap` documentation, but also at the `LAMMPS website 67 | `_. 68 | 69 | GAP Functionality 70 | ----------------- 71 | 72 | GAP functionality is provided by :code:`QUIP`. The package (and installation 73 | steps) are available at `this link `_. 74 | -------------------------------------------------------------------------------- /examples/ace_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | project_name: opt_ACE 5 | sweep_name: test_ace 6 | error_method: rmse 7 | alpha: 0.7, 8 | } 9 | "cutoff": 6, 10 | "seed": 42 11 | "metadata": { 12 | "purpose": "Potential fit" 13 | }, 14 | "data": { 15 | "filename": "/Users/dft-dutoit/Documents/xpot/examples/cu_icams.pckl.gzip", 16 | "test_size": 0.10 17 | }, 18 | "potential": { 19 | "deltaSplineBins": 0.001, 20 | "elements": ["Cu"], 21 | "embeddings": { 22 | "ALL": { 23 | "npot": "FinnisSinclairShiftedScaled", 24 | "fs_parameters": [1,1,1,"skopt.space.Real(0.1, 2)"], 25 | "ndensity": 2, 26 | "rho_core_cut": 3000, 27 | "drho_core_cut": 500 28 | } 29 | }, 30 | "rankmax": "", 31 | "bonds": { 32 | "ALL": { 33 | "radbase": "SBessel", 34 | "radparameters": ["skopt.space.Real(1,10)"], 35 | "rcut": "skopt.space.Real(3,6)", 36 | "dcut": "skopt.space.Real(0.001, 0.1)", 37 | "r_in": "", 38 | "delta_in": "", 39 | "core-repulsion": "", 40 | "NameofCutoffFunction": "cos" 41 | } 42 | }, 43 | "functions": { 44 | "number_of_functions_per_element": "skopt.space.Integer(10,100)", 45 | "ALL": { 46 | "nradmax_by_orders": [15,6,4,3,2,2], 47 | "lmax_by_orders": [0,4,3,2,1,0], 48 | "coeffs_init": "" 49 | }, 50 | "initial_potential": "" 51 | } 52 | }, 53 | "fit": { 54 | "loss": { 55 | "kappa": "auto", 56 | "L1_coeffs": 1e-8, 57 | "L2_coeffs": 1e-8, 58 | "w0_rad": 1e-8, 59 | "w1_rad": 1e-8, 60 | "w2_rad": 1e-8, 61 | "w1_coeffs": 0, 62 | "w2_coeffs": 0, 63 | "w_orth": "" 64 | }, 65 | // "weighting": { 66 | // "type": "EnergyBasedWeightingPolicy", 67 | // "filename": "", 68 | // "nfit": 20000, 69 | // "cutoff": "", 70 | // "DEup": 1000, 71 | // "DFup": "", 72 | // "DElow": 1.0, 73 | // "DE": 1, 74 | // "DF": 1, 75 | // "wlow": "", 76 | // "energy": "convex_hull", 77 | // "reftype": "all", 78 | // "seed": 42 79 | // }, 80 | "optimizer": "BFGS", 81 | "options": "", 82 | "maxiter": 10, 83 | "repulsion": "auto", 84 | "trainable_parameters": "ALL", 85 | "fit_cycles": "", 86 | "noise_relative_sigma":"", 87 | "noise_absolute_sigma":"", 88 | "randomize_func_coeffs": "", 89 | //"ladder_step": 1000, 90 | //"ladder_type":"power_order", 91 | "callbacks":"" 92 | }, 93 | "backend": { 94 | "evaluator": "tensorpot", 95 | "batch_size": 50, 96 | "batch_size_reduction": "True", 97 | "batch_size_reduction_factor": 2, 98 | "display_step": 50, 99 | "gpu_config": {"mem_limit": 0} 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /examples/ace_optimise.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from xpot.models.ace import PACE 4 | from xpot.optimiser import NamedOptimiser 5 | 6 | mlip = PACE("ace_input.hjson") 7 | 8 | kwargs = { 9 | "n_initial_points": 5, 10 | } 11 | 12 | opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs) 13 | n_calls = 10 14 | 15 | while opt.iter <= n_calls: 16 | opt.run_optimisation(mlip.fit, path=mlip.sweep_path) 17 | 18 | opt.tabulate_final_results(mlip.sweep_path) 19 | -------------------------------------------------------------------------------- /examples/gap_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: gap_fit 4 | project_name: tests/mock_runs/test_models 5 | sweep_name: gap 6 | error_method: rmse 7 | validation_data: "/u/vld/scat7402/Documents/xpot-v2/examples/gap_C_XYZ/suft_amo_test.xyz" 8 | alpha: 0.5, 9 | }, 10 | 11 | "at_file": "/u/vld/scat7402/Documents/xpot-v2/examples/gap_C_XYZ/bulk_cryst_train.xyz", 12 | 13 | "gap": { 14 | "distance_Nb": { 15 | "order": 2, 16 | "f0": 0.0, 17 | "cutoff": "skopt.space.Real(4,7)", 18 | "n_sparse": 15, 19 | "delta": 2.0, 20 | "config_type_n_sparse": "", 21 | "sparse_method": "random", 22 | "mark_sparse_atoms": "F", 23 | "add_species": "T", 24 | "covariance_type": "gaussian", 25 | "theta_uniform": 1.0, 26 | } 27 | }, 28 | 29 | "core_param_file": "", 30 | "core_ip_args": "", 31 | "energy_parameter_name": "energy", 32 | "local_property_parameter_name": "local_property", 33 | "force_parameter_name": "forces", 34 | "virial_parameter_name": "virial", 35 | "hessian_parameter_name": "hessian", 36 | "config_type_parameter_name": "config_type", 37 | "sigma_parameter_name": "sigma", 38 | "force_mask_parameter_name": "force_mask", 39 | "parameter_name_prefix": "", 40 | "gap_file": "gap.xml", 41 | "verbosity": "NORMAL", 42 | "template_file": "", 43 | "sparsify_only_no_fit": "F", 44 | "e0": "0.0", 45 | "local_property0": "0.0", 46 | "e0_offset": "0.0", 47 | "e0_method": "isolated", 48 | "default_sigma": [0.002,0.2,0.2,0.0], # Must be parsed as a list. 49 | "sparse_jitter": "1.0e-8", 50 | "hessian_delta": "1.0e-2", 51 | "config_type_kernel_regularisation": "", 52 | "config_type_sigma energy": "", 53 | "config_type_sigma force": "", 54 | "config_type_sigma virial": "", 55 | "config_type_sigma hessian": "", 56 | "kernel_regularisation_is_per_atom": "T", 57 | "sigma_per_atom": "T", 58 | "do_copy_atoms_file": "T", 59 | "do_copy_at_file": "T", 60 | "sparse_separate_file": "T", 61 | "sparse_use_actual_gpcov": "F", 62 | "rnd_seed": "1", 63 | "openmp_chunk_size": "10000", 64 | "do_ip_timing": "F" 65 | } -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/cycle_metrics.txt: -------------------------------------------------------------------------------- 1 | ladder_step cycle_step loss e_loss_contrib f_loss_contrib reg_loss rmse_epa rmse_f_comp low_rmse_epa low_rmse_f_comp mae_f_comp low_mae_f_comp nfuncs ncoefs l1_reg_contrib l2_reg_contrib smooth_orth smooth_w1 smooth_w2 smooth_w3 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/fitting_data_info.pckl.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/examples/opt_ACE/test_ace/1/fitting_data_info.pckl.gzip -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/metrics.txt: -------------------------------------------------------------------------------- 1 | ladder_step cycle_step iter_num loss e_loss_contrib f_loss_contrib reg_loss rmse_epa rmse_f_comp low_rmse_epa low_rmse_f_comp mae_f_comp low_mae_f_comp nfuncs ncoefs l1_reg_contrib l2_reg_contrib smooth_orth smooth_w1 smooth_w2 smooth_w3 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/test_cycle_metrics.txt: -------------------------------------------------------------------------------- 1 | ladder_step cycle_step loss e_loss_contrib f_loss_contrib reg_loss rmse_epa rmse_f_comp low_rmse_epa low_rmse_f_comp mae_f_comp low_mae_f_comp nfuncs ncoefs l1_reg_contrib l2_reg_contrib smooth_orth smooth_w1 smooth_w2 smooth_w3 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/test_data_info.pckl.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/examples/opt_ACE/test_ace/1/test_data_info.pckl.gzip -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/test_ef-distributions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/examples/opt_ACE/test_ace/1/test_ef-distributions.png -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/test_ladder_metrics.txt: -------------------------------------------------------------------------------- 1 | ladder_step loss e_loss_contrib f_loss_contrib reg_loss rmse_epa rmse_f_comp low_rmse_epa low_rmse_f_comp mae_f_comp low_mae_f_comp nfuncs ncoefs l1_reg_contrib l2_reg_contrib smooth_orth smooth_w1 smooth_w2 smooth_w3 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/test_metrics.txt: -------------------------------------------------------------------------------- 1 | ladder_step cycle_step iter_num loss e_loss_contrib f_loss_contrib reg_loss rmse_epa rmse_f_comp low_rmse_epa low_rmse_f_comp mae_f_comp low_mae_f_comp nfuncs ncoefs l1_reg_contrib l2_reg_contrib smooth_orth smooth_w1 smooth_w2 smooth_w3 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/train_ef-distributions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/examples/opt_ACE/test_ace/1/train_ef-distributions.png -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/1/xpot-ace.yaml: -------------------------------------------------------------------------------- 1 | backend: 2 | batch_size: 50 3 | batch_size_reduction: 'True' 4 | batch_size_reduction_factor: 2 5 | display_step: 50 6 | evaluator: tensorpot 7 | gpu_config: 8 | mem_limit: 0 9 | cutoff: 6 10 | data: 11 | filename: /Users/dft-dutoit/Documents/xpot/examples/cu_icams.pckl.gzip 12 | test_size: 0.1 13 | fit: 14 | loss: 15 | L1_coeffs: 1.0e-08 16 | L2_coeffs: 1.0e-08 17 | kappa: auto 18 | w0_rad: 1.0e-08 19 | w1_coeffs: 0 20 | w1_rad: 1.0e-08 21 | w2_coeffs: 0 22 | w2_rad: 1.0e-08 23 | maxiter: 10 24 | optimizer: BFGS 25 | repulsion: auto 26 | trainable_parameters: ALL 27 | metadata: 28 | purpose: Potential fit 29 | potential: 30 | bonds: 31 | ALL: 32 | NameofCutoffFunction: cos 33 | dcut: 0.060088165636702225 34 | radbase: SBessel 35 | radparameters: 36 | - 2.6509131087954745 37 | rcut: 5.339073000818308 38 | deltaSplineBins: 0.001 39 | elements: 40 | - Cu 41 | embeddings: 42 | ALL: 43 | drho_core_cut: 500 44 | fs_parameters: 45 | - 1 46 | - 1 47 | - 1 48 | - 1.6134316750344428 49 | ndensity: 2 50 | npot: FinnisSinclairShiftedScaled 51 | rho_core_cut: 3000 52 | functions: 53 | ALL: 54 | lmax_by_orders: 55 | - 0 56 | - 4 57 | - 3 58 | - 2 59 | - 1 60 | - 0 61 | nradmax_by_orders: 62 | - 15 63 | - 6 64 | - 4 65 | - 3 66 | - 2 67 | - 2 68 | number_of_functions_per_element: 50 69 | seed: 42 70 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/atomistic_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/loss_function_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | -------------------------------------------------------------------------------- /examples/opt_ACE/test_ace/parameters.csv: -------------------------------------------------------------------------------- 1 | iteration,loss,potential embeddings ALL fs_parameters 3,potential bonds ALL radparameters 0,potential bonds ALL rcut,potential bonds ALL dcut,potential functions number_of_functions_per_element 2 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/1/gap.xml.sparseX.GAP_2024_2_15_0_11_51_35_3621: -------------------------------------------------------------------------------- 1 | 6.28127077906686448472e+00 2 | 5.02911745960603706607e+00 3 | 4.32127212754871070644e+00 4 | 3.57256929965773251112e+00 5 | 6.27931710921753349908e+00 6 | 4.44243542560595017221e+00 7 | 5.04682413541070395979e+00 8 | 5.70702116037722184672e+00 9 | 4.18875828588701448751e+00 10 | 5.76440788246256108351e+00 11 | 3.53384985515392502364e+00 12 | 5.36049628177832726550e+00 13 | 4.89658612945929672122e+00 14 | 2.50495341054089015742e+00 15 | 5.28668618050236016614e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/10/gap.xml.sparseX.GAP_2024_2_15_0_11_57_6_4491: -------------------------------------------------------------------------------- 1 | 3.16850586030576897301e+00 2 | 3.61417396047594285946e+00 3 | 4.06107744247160340478e+00 4 | 3.99483580039750219015e+00 5 | 3.51339699999999988123e+00 6 | 4.07885820750084970854e+00 7 | 3.89068513324426668021e+00 8 | 2.55004024146524210792e+00 9 | 3.51019250895318002392e+00 10 | 3.47574123639864396296e+00 11 | 3.09595581233036254432e+00 12 | 3.35267905456422399268e+00 13 | 1.37380375047308000980e+00 14 | 1.53742173064166909313e+00 15 | 3.90593532241104091085e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/2/gap.xml.sparseX.GAP_2024_2_15_0_11_52_25_5321: -------------------------------------------------------------------------------- 1 | 3.66914197580581502578e+00 2 | 4.27243446692651929197e+00 3 | 1.48846154251005913238e+00 4 | 4.03401104404113652890e+00 5 | 4.48146762067628490200e+00 6 | 3.80930377901074601610e+00 7 | 3.94663434692267367510e+00 8 | 3.81585221716874478659e+00 9 | 3.86976350203350616397e+00 10 | 3.30269632623607822808e+00 11 | 1.33146532022293118125e+00 12 | 4.50336871478509159772e+00 13 | 2.26649900000000004141e+00 14 | 2.40561390249832429689e+00 15 | 3.78286067415419813287e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/3/gap.xml.sparseX.GAP_2024_2_15_0_11_52_53_5031: -------------------------------------------------------------------------------- 1 | 3.32027285727935295156e+00 2 | 5.27541179812783589398e+00 3 | 4.91979110361732985268e+00 4 | 4.34455754864977450325e+00 5 | 6.13406595170248269966e+00 6 | 5.17280149728300830958e+00 7 | 4.37200778225464414817e+00 8 | 5.73292933975158103266e+00 9 | 5.78227917430620497186e+00 10 | 5.28917513888850177040e+00 11 | 3.74941562352993829066e+00 12 | 3.57774524049717701502e+00 13 | 4.35358123537742702780e+00 14 | 4.32438553849861317957e+00 15 | 5.28668618050236016614e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/4/gap.xml.sparseX.GAP_2024_2_15_0_11_53_49_1601: -------------------------------------------------------------------------------- 1 | 2.62947932029936737308e+00 2 | 5.41848087558925772811e+00 3 | 5.30603710828989250103e+00 4 | 2.85316400352472099300e+00 5 | 5.10403091857175539303e+00 6 | 4.07838045939272042517e+00 7 | 4.59442090354996945933e+00 8 | 4.47382802552224312365e+00 9 | 4.60694409398213000628e+00 10 | 5.71151805711880733440e+00 11 | 4.80924826092296342495e+00 12 | 3.55654392082146264542e+00 13 | 4.35358262592911415823e+00 14 | 4.97485535102700193733e+00 15 | 3.78286067415419813287e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/5/gap.xml.sparseX.GAP_2024_2_15_0_11_54_36_3531: -------------------------------------------------------------------------------- 1 | 4.01923593703463843951e+00 2 | 5.19591063387789287020e+00 3 | 4.91455751340868207677e+00 4 | 4.09835047270207031289e+00 5 | 2.39476839989413203824e+00 6 | 5.10403091857175539303e+00 7 | 4.56315519350842624391e+00 8 | 4.69641272014270150237e+00 9 | 3.55416687139393161488e+00 10 | 2.33007685844909406825e+00 11 | 4.88501198459158558762e+00 12 | 4.69029422122780736970e+00 13 | 4.97165883399375729823e+00 14 | 4.19849261418863672901e+00 15 | 3.78286067415419813287e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/6/gap.xml.sparseX.GAP_2024_2_15_0_11_55_17_2831: -------------------------------------------------------------------------------- 1 | 2.71914046340688697612e+00 2 | 2.81536617031730473926e+00 3 | 2.70749217902363792376e+00 4 | 3.61323904416303554044e+00 5 | 3.75910422928347198734e+00 6 | 2.85209162907482483007e+00 7 | 3.94083676760083978508e+00 8 | 3.04949267307264060278e+00 9 | 1.32672699329942833657e+00 10 | 3.33649626524373799086e+00 11 | 3.43102532065402554551e+00 12 | 2.65502424159277738980e+00 13 | 3.45164213978626976953e+00 14 | 2.48739195648283351048e+00 15 | 3.77132870566808042767e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/7/gap.xml.sparseX.GAP_2024_2_15_0_11_55_42_1511: -------------------------------------------------------------------------------- 1 | 2.71914046340688697612e+00 2 | 2.81536617031730473926e+00 3 | 2.70749217902363792376e+00 4 | 3.61323904416303554044e+00 5 | 3.75910422928347198734e+00 6 | 2.85209162907482483007e+00 7 | 3.94083676760083978508e+00 8 | 3.04949267307264060278e+00 9 | 1.32672699329942833657e+00 10 | 3.33649626524373799086e+00 11 | 3.43102532065402554551e+00 12 | 2.65502424159277738980e+00 13 | 3.45164213978626976953e+00 14 | 2.48739195648283351048e+00 15 | 3.77132870566808042767e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/8/gap.xml.sparseX.GAP_2024_2_15_0_11_56_8_4181: -------------------------------------------------------------------------------- 1 | 3.98215342576667330476e+00 2 | 3.94836042172033030440e+00 3 | 4.06107744247160340478e+00 4 | 3.97369399114875321288e+00 5 | 2.88062043796057709599e+00 6 | 2.43599481384917648796e+00 7 | 2.91825258610688687000e+00 8 | 2.57741643492163508000e+00 9 | 3.51019250895318002392e+00 10 | 3.86782481415929879631e+00 11 | 1.30751425722240166571e+00 12 | 1.32664023109559603419e+00 13 | 3.92231201657772210467e+00 14 | 2.47829442508230668452e+00 15 | 3.90593532241104091085e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/9/gap.xml.sparseX.GAP_2024_2_15_0_11_56_36_5271: -------------------------------------------------------------------------------- 1 | 4.11398263734462066310e+00 2 | 2.80701276760282691924e+00 3 | 4.06863871544648514345e+00 4 | 3.49189025552762544180e+00 5 | 4.12474397266360703895e+00 6 | 3.64560885911717846852e+00 7 | 2.91360422051696144052e+00 8 | 3.98540910234394951672e+00 9 | 2.65345866000008445695e+00 10 | 3.78999009687609289543e+00 11 | 2.68140772158772922040e+00 12 | 4.01610876370808345115e+00 13 | 3.92231201657772210467e+00 14 | 2.96714742404129516729e+00 15 | 3.90593532241104091085e+00 16 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/atomistic_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | 1,1.7209168333612908,93.50016801683876,19.79191374090202,74.8613618064757 3 | 2,0.5680312435381394,10.621673494790622,19.997899543814864,108.83358745420229 4 | 3,1.7686797569891892,74.90095201170652,20.171397146539537,70.26533334045129 5 | 4,1.0775656865774854,42.308322216378535,10.76054611513172,84.58993161493088 6 | 5,0.8548664043795849,30.334192872719523,12.388126397976743,92.50387717675143 7 | 6,0.7054687703823055,10.098700539649409,24.30644545463004,109.271496509811 8 | 7,0.7054687703823067,10.098700539649409,24.30644545463004,109.271496509811 9 | 8,0.5389242196494448,8.768694941634676,24.523435350495486,115.4213666837012 10 | 9,0.7627532845885159,9.957458267480524,18.84436797408757,104.20052927705885 11 | 10,0.5713661370891252,8.86988977832239,23.530919823909862,113.35272268286793 12 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/atomistic_errors_final: -------------------------------------------------------------------------------- 1 | | Iteration | Train Δ Energy | Test Δ Energy | Train Δ Force | Test Δ Force | 2 | |-------------|------------------|-----------------|-----------------|----------------| 3 | | 1 | 1.72092 | 93.5002 | 19.7919 | 74.8614 | 4 | | 2 | 0.568031 | 10.6217 | 19.9979 | 108.834 | 5 | | 3 | 1.76868 | 74.901 | 20.1714 | 70.2653 | 6 | | 4 | 1.07757 | 42.3083 | 10.7605 | 84.5899 | 7 | | 5 | 0.854866 | 30.3342 | 12.3881 | 92.5039 | 8 | | 6 | 0.705469 | 10.0987 | 24.3064 | 109.271 | 9 | | 7 | 0.705469 | 10.0987 | 24.3064 | 109.271 | 10 | | 8 | 0.538924 | 8.76869 | 24.5234 | 115.421 | 11 | | 9 | 0.762753 | 9.95746 | 18.8444 | 104.201 | 12 | | 10 | 0.571366 | 8.86989 | 23.5309 | 113.353 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/loss_function_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | 1,3.7010280184331443,825.5546725882905,19.79191374090202,74.8613618064757 3 | 2,1.2358679232886467,86.92490451279474,19.997899543814864,108.83358745420229 4 | 3,3.780004877477588,659.3333834541219,20.171397146539537,70.26533334045129 5 | 4,2.2902051935268966,372.1490930942337,10.76054611513172,84.58993161493088 6 | 5,1.850131834108458,264.57411216335873,12.388126397976743,92.50387717675143 7 | 6,1.7249844606404643,83.07465282468308,24.30644545463004,109.271496509811 8 | 7,1.7249844606404674,83.0746528246831,24.30644545463004,109.271496509811 9 | 8,1.2683330778281132,71.31949464979434,24.523435350495486,115.4213666837012 10 | 9,1.7273103107863084,81.55778792125754,18.84436797408757,104.20052927705885 11 | 10,1.3345190701532614,72.18783136497315,23.530919823909862,113.35272268286793 12 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/loss_function_errors_final: -------------------------------------------------------------------------------- 1 | | Iteration | Train Δ Energy | Test Δ Energy | Train Δ Force | Test Δ Force | 2 | |-------------|------------------|-----------------|-----------------|----------------| 3 | | 1 | 3.70103 | 825.555 | 19.7919 | 74.8614 | 4 | | 2 | 1.23587 | 86.9249 | 19.9979 | 108.834 | 5 | | 3 | 3.78 | 659.333 | 20.1714 | 70.2653 | 6 | | 4 | 2.29021 | 372.149 | 10.7605 | 84.5899 | 7 | | 5 | 1.85013 | 264.574 | 12.3881 | 92.5039 | 8 | | 6 | 1.72498 | 83.0747 | 24.3064 | 109.271 | 9 | | 7 | 1.72498 | 83.0747 | 24.3064 | 109.271 | 10 | | 8 | 1.26833 | 71.3195 | 24.5234 | 115.421 | 11 | | 9 | 1.72731 | 81.5578 | 18.8444 | 104.201 | 12 | | 10 | 1.33452 | 72.1878 | 23.5309 | 113.353 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/parameters.csv: -------------------------------------------------------------------------------- 1 | iteration,loss,gap distance_Nb cutoff 2 | 1,450.20801719738307,6.3896289605806995 3 | 2,97.87924598349852,4.550304369598491 4 | 3,364.7993583972866,6.339073000818308 5 | 4,228.3695123545823,5.7905504738394615 6 | 5,178.53899467005508,5.337498258560774 7 | 6,96.17307466724705,4.0 8 | 7,96.17307466724705,4.0 9 | 8,93.37043066674777,4.198185265208693 10 | 9,92.87915859915819,4.1958220270522455 11 | 10,92.77027702392054,4.186318733016118 12 | -------------------------------------------------------------------------------- /examples/opt_GAP/test_GAP/parameters_final: -------------------------------------------------------------------------------- 1 | | iteration | loss | gap distance_Nb cutoff | 2 | |-------------|----------|--------------------------| 3 | | 1 | 450.208 | 6.38963 | 4 | | 2 | 97.8792 | 4.5503 | 5 | | 3 | 364.799 | 6.33907 | 6 | | 4 | 228.37 | 5.79055 | 7 | | 5 | 178.539 | 5.3375 | 8 | | 6 | 96.1731 | 4 | 9 | | 7 | 96.1731 | 4 | 10 | | 8 | 93.3704 | 4.19819 | 11 | | 9 | 92.8792 | 4.19582 | 12 | | 10 | 92.7703 | 4.18632 | -------------------------------------------------------------------------------- /examples/snap-optimization/py-xpot.py: -------------------------------------------------------------------------------- 1 | from xpot.models import SNAP 2 | from xpot.optimiser import NamedOptimiser 3 | 4 | mlip = SNAP("./4q-si-gap18.hjson") 5 | 6 | kwargs = { 7 | "n_initial_points": 3, 8 | "initial_point_generator": "hammersly", 9 | "verbose": True, 10 | "n_jobs": 1, 11 | } 12 | 13 | opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs) 14 | n_calls = 10 15 | 16 | while opt.iter <= n_calls: 17 | opt.run_optimisation(mlip.fit, path=mlip.sweep_path) 18 | 19 | opt.tabulate_final_results(mlip.sweep_path) 20 | 21 | # Alternatively can use the optimise method directly: 22 | # from xpot.workflows import optimise 23 | # # mlip_obj is the class object of the MLIP model 24 | # optimise(SNAP, input_file, kwargs, max_iter=n_calls, min_loss=0.1, time_limit = 360) 25 | -------------------------------------------------------------------------------- /examples/snap-optimization/snap_input_updated.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: "fitsnap3", # The fitSNAP executable, if fitSNAP has been added to path then this works out of the box. 4 | project_name: "opt_SNAP", # main project folder which will be created/added to in the base directory 5 | sweep_name: "si-gap-18-hammer-100", # name of the sweep folder which will be created in the project folder, and contain all iterations 6 | error_method: "rmse", # error method to use in optimization and reporting, either rmse or mae 7 | alpha: "1", # value between 0 and 1 which determines the relative importance of energy and force errors in the error metric 8 | training_data: "./snap_Ta_XYZ/total_train.xyz", # path to training data: Needed for populating training errors. Does not feed into SNAP as that can have many files (see [GROUPS]). 9 | validaton_data: "./snap_Ta_XYZ/total_test.xyz", # path to the validation data 10 | xval_sets: "1" # number of cross validation sets to use in the optimization [CURRENTLY UNDERGOING UPGRADES, REAMIN AS 1 FOR NOW AND USE EXTERNAL SET] 11 | }, 12 | # For more information on SNAP hyperparameters, please see the fitSNAP github page. 13 | "[BISPECTRUM]": { 14 | "numTypes" : 1, 15 | "twojmax" : 6 16 | "rcutfac" : "skopt.space.Real(4,6)" 17 | "rfac0" : 0.99363 18 | "rmin0" : 0.0 19 | "wj" : 1.0 20 | "radelem" : 0.5 21 | "type" : "Ta" 22 | "wselfallflag" : 0 23 | "chemflag" : 0 24 | "bzeroflag" : 0 25 | "quadraticflag" : 0 26 | }, 27 | "[CALCULATOR]":{ 28 | "calculator" : LAMMPSSNAP 29 | "energy" : 1 30 | "force" : 1 31 | "stress" : 1 32 | }, 33 | "[ESHIFT]": { 34 | "Ta" : 0.0 35 | }, 36 | "[SOLVER]":{ 37 | solver : SVD 38 | compute_testerrs : 1 39 | detailed_errors : 1 40 | }, 41 | "[SCRAPER]":{ 42 | "scraper" : "XYZ" 43 | }, 44 | "[PATH]": { 45 | "dataPath": "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ" 46 | }, 47 | "[OUTFILE]": { 48 | "metrics": "Ta_metrics.md" 49 | "potential": "Ta_pot" 50 | }, 51 | "[REFERENCE]": { 52 | units : metal 53 | atom_style : atomic 54 | pair_style : "hybrid/overlay zero 10.0 zbl 4.0 4.8" 55 | pair_coeff1 : "* * zero" 56 | pair_coeff2 : "* * zbl 73 73" 57 | }, 58 | "[GROUPS]": { 59 | group_sections : "name training_size testing_size eweight fweight vweight", 60 | group_types : "str float float float float float", 61 | smartweights : 0 62 | random_sampling : 0 63 | Displaced_A15 : [1.0,0.0,100,1,1.00E-08], 64 | Displaced_BCC : [1.0,0.0,100,1,1.00E-08], 65 | Displaced_FCC : [1.0,0.0,100,1,1.00E-08], 66 | Elastic_BCC : [1.0,0.0,1.00E-08,1.00E-08,0.0001], 67 | Elastic_FCC : [1.0,0.0,1.00E-09,1.00E-09,1.00E-09], 68 | GSF_110 : [1.0,0.0,100,1,1.00E-08], 69 | GSF_112 : [1.0,0.0,100,1,1.00E-08], 70 | Liquid : [1.0,0.0,4.67E+02,1,1.00E-08], 71 | Surface : [1.0,0.0,100,1,1.00E-08], 72 | Volume_A15 : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 73 | Volume_BCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 74 | Volume_FCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 75 | }, 76 | "[EXTRAS]": { 77 | dump_descriptors : 1 78 | dump_truth : 1 79 | dump_weights : 1 80 | dump_dataframe : 1 81 | }, 82 | "[MEMORY]": { 83 | "override" : 0 84 | } 85 | } -------------------------------------------------------------------------------- /examples/snap_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: fitsnap3 4 | project_name: opt_SNAP 5 | sweep_name: test_SNAP 6 | error_method: rmse 7 | training_data: "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ/Displaced_A15.xyz" 8 | validation_data: "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ/Elastic_BCC.xyz" 9 | alpha: 0.5, 10 | }, 11 | "[BISPECTRUM]": { 12 | "numTypes" : 1, 13 | twojmax : 6 14 | "rcutfac" : "skopt.space.Real(4,6)" 15 | "rfac0" : 0.99363 16 | "rmin0" : 0.0 17 | "wj" : 1.0 18 | "radelem" : 0.5 19 | "type" : "Ta" 20 | "wselfallflag" : 0 21 | "chemflag" : 0 22 | "bzeroflag" : 0 23 | "quadraticflag" : 0 24 | }, 25 | "[CALCULATOR]":{ 26 | "calculator" : LAMMPSSNAP 27 | "energy" : 1 28 | "force" : 1 29 | "stress" : 1 30 | }, 31 | "[ESHIFT]": { 32 | "Ta" : 0.0 33 | }, 34 | "[SOLVER]":{ 35 | solver : SVD 36 | compute_testerrs : 1 37 | detailed_errors : 1 38 | }, 39 | "[SCRAPER]":{ 40 | "scraper" : "XYZ" 41 | }, 42 | "[PATH]": { 43 | "dataPath": "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ" 44 | }, 45 | "[OUTFILE]": { 46 | "metrics": "Ta_metrics.md" 47 | "potential": "Ta_pot" 48 | }, 49 | "[REFERENCE]": { 50 | units : metal 51 | atom_style : atomic 52 | pair_style : "hybrid/overlay zero 10.0 zbl 4.0 4.8" 53 | pair_coeff1 : "* * zero" 54 | pair_coeff2 : "* * zbl 73 73" 55 | }, 56 | "[GROUPS]": { 57 | group_sections : "name training_size testing_size eweight fweight vweight", 58 | group_types : "str float float float float float", 59 | smartweights : 0 60 | random_sampling : 0 61 | Displaced_A15 : [1.0,0.0,100,1,1.00E-08], 62 | Displaced_BCC : [1.0,0.0,100,1,1.00E-08], 63 | Displaced_FCC : [1.0,0.0,100,1,1.00E-08], 64 | Elastic_BCC : [1.0,0.0,1.00E-08,1.00E-08,0.0001], 65 | Elastic_FCC : [1.0,0.0,1.00E-09,1.00E-09,1.00E-09], 66 | GSF_110 : [1.0,0.0,100,1,1.00E-08], 67 | GSF_112 : [1.0,0.0,100,1,1.00E-08], 68 | Liquid : [1.0,0.0,4.67E+02,1,1.00E-08], 69 | Surface : [1.0,0.0,100,1,1.00E-08], 70 | Volume_A15 : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 71 | Volume_BCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 72 | Volume_FCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 73 | }, 74 | "[EXTRAS]": { 75 | dump_descriptors : 1 76 | dump_truth : 1 77 | dump_weights : 1 78 | dump_dataframe : 1 79 | }, 80 | "[MEMORY]": { 81 | "override" : 0 82 | }, 83 | 84 | } 85 | -------------------------------------------------------------------------------- /examples/snap_optimise.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "!export PYTHONPATH=/u/vld/scat7402/software/FitSNAP:$PYTHONPATH" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "from xpot.models import SNAP\n", 19 | "\n", 20 | "mlip = SNAP(\"/u/vld/scat7402/Documents/xpot-v2/examples/snap_input.hjson\")" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "from xpot.optimiser import NamedOptimiser\n", 30 | "\n", 31 | "kwargs = {\n", 32 | " \"n_initial_points\": 5,\n", 33 | " }\n", 34 | "\n", 35 | "opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs)" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "n_calls = 10\n", 45 | "\n", 46 | "while opt.iter <= n_calls:\n", 47 | " opt.run_optimisation(mlip.fit, path = mlip.sweep_path)" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [ 56 | "opt.tabulate_final_results(mlip.sweep_path)" 57 | ] 58 | } 59 | ], 60 | "metadata": { 61 | "kernelspec": { 62 | "display_name": "xpot-dev", 63 | "language": "python", 64 | "name": "python3" 65 | }, 66 | "language_info": { 67 | "codemirror_mode": { 68 | "name": "ipython", 69 | "version": 3 70 | }, 71 | "file_extension": ".py", 72 | "mimetype": "text/x-python", 73 | "name": "python", 74 | "nbconvert_exporter": "python", 75 | "pygments_lexer": "ipython3", 76 | "version": "3.10.13" 77 | } 78 | }, 79 | "nbformat": 4, 80 | "nbformat_minor": 2 81 | } 82 | -------------------------------------------------------------------------------- /examples/snap_optimise.py: -------------------------------------------------------------------------------- 1 | from xpot.models.snap import SNAP 2 | from xpot.optimiser import NamedOptimiser 3 | 4 | mlip = SNAP("/u/vld/scat7402/Documents/xpot-v2/examples/snap_input.hjson") 5 | 6 | kwargs = { 7 | "n_initial_points": 5, 8 | } 9 | 10 | opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs) 11 | n_calls = 10 12 | 13 | while opt.iter <= n_calls: 14 | opt.run_optimisation(mlip.fit, path=mlip.sweep_path) 15 | 16 | opt.tabulate_final_results(mlip.sweep_path) 17 | -------------------------------------------------------------------------------- /examples/xpot-v1.2/ace_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | project_name: opt_ACE 5 | sweep_name: test_ace 6 | error_method: rmse 7 | alpha: 0.7, 8 | } 9 | "cutoff": 6, 10 | "seed": 42 11 | "metadata": { 12 | "purpose": "Potential fit" 13 | }, 14 | "data": { 15 | "filename": "/u/vld/scat7402/Documents/xpot-v2/examples/cu_icams.pckl.gzip", 16 | "test_size": 0.10 17 | }, 18 | "potential": { 19 | "deltaSplineBins": 0.001, 20 | "elements": ["Cu"], 21 | "embeddings": { 22 | "ALL": { 23 | "npot": "FinnisSinclairShiftedScaled", 24 | "fs_parameters": [1,1,1,"skopt.space.Real(0.1, 2)"], 25 | "ndensity": 2, 26 | "rho_core_cut": 3000, 27 | "drho_core_cut": 500 28 | } 29 | }, 30 | "rankmax": "", 31 | "bonds": { 32 | "ALL": { 33 | "radbase": "SBessel", 34 | "radparameters": ["skopt.space.Real(1,10)"], 35 | "rcut": "skopt.space.Real(3,6)", 36 | "dcut": "skopt.space.Real(0.001, 0.1)", 37 | "r_in": "", 38 | "delta_in": "", 39 | "core-repulsion": "", 40 | "NameofCutoffFunction": "cos" 41 | } 42 | }, 43 | "functions": { 44 | "number_of_functions_per_element": "skopt.space.Integer(10,100)", 45 | "ALL": { 46 | "nradmax_by_orders": [15,6,4,3,2,2], 47 | "lmax_by_orders": [0,4,3,2,1,0], 48 | "coeffs_init": "" 49 | }, 50 | "initial_potential": "" 51 | } 52 | }, 53 | "fit": { 54 | "loss": { 55 | "kappa": "auto", 56 | "L1_coeffs": 1e-8, 57 | "L2_coeffs": 1e-8, 58 | "w0_rad": 1e-8, 59 | "w1_rad": 1e-8, 60 | "w2_rad": 1e-8, 61 | "w1_coeffs": 0, 62 | "w2_coeffs": 0, 63 | "w_orth": "" 64 | }, 65 | // "weighting": { 66 | // "type": "EnergyBasedWeightingPolicy", 67 | // "filename": "", 68 | // "nfit": 20000, 69 | // "cutoff": "", 70 | // "DEup": 1000, 71 | // "DFup": "", 72 | // "DElow": 1.0, 73 | // "DE": 1, 74 | // "DF": 1, 75 | // "wlow": "", 76 | // "energy": "convex_hull", 77 | // "reftype": "all", 78 | // "seed": 42 79 | // }, 80 | "optimizer": "BFGS", 81 | "options": "", 82 | "maxiter": 10, 83 | "repulsion": "auto", 84 | "trainable_parameters": "ALL", 85 | "fit_cycles": "", 86 | "noise_relative_sigma":"", 87 | "noise_absolute_sigma":"", 88 | "randomize_func_coeffs": "", 89 | //"ladder_step": 1000, 90 | //"ladder_type":"power_order", 91 | "callbacks":"" 92 | }, 93 | "backend": { 94 | "evaluator": "tensorpot", 95 | "batch_size": 50, 96 | "batch_size_reduction": "True", 97 | "batch_size_reduction_factor": 2, 98 | "display_step": 50, 99 | "gpu_config": {"mem_limit": 0} 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /examples/xpot-v1.2/gap_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: gap_fit 4 | project_name: opt_GAP 5 | sweep_name: test_GAP 6 | error_method: rmse 7 | validation_data: "/u/vld/scat7402/Documents/xpot-v2/examples/gap_C_XYZ/suft_amo_test.xyz" 8 | alpha: 0.5, 9 | }, 10 | 11 | "at_file": "/u/vld/scat7402/Documents/xpot-v2/examples/gap_C_XYZ/bulk_cryst_train.xyz", 12 | 13 | "gap": { 14 | "distance_Nb": { 15 | "order": 2, 16 | "f0": 0.0, 17 | "cutoff": "skopt.space.Real(4,7)", 18 | "n_sparse": 15, 19 | "delta": 2.0, 20 | "config_type_n_sparse": "", 21 | "sparse_method": "random", 22 | "mark_sparse_atoms": "F", 23 | "add_species": "T", 24 | "covariance_type": "gaussian", 25 | "theta_uniform": 1.0, 26 | } 27 | }, 28 | 29 | "core_param_file": "", 30 | "core_ip_args": "", 31 | "energy_parameter_name": "energy", 32 | "local_property_parameter_name": "local_property", 33 | "force_parameter_name": "forces", 34 | "virial_parameter_name": "virial", 35 | "hessian_parameter_name": "hessian", 36 | "config_type_parameter_name": "config_type", 37 | "sigma_parameter_name": "sigma", 38 | "force_mask_parameter_name": "force_mask", 39 | "parameter_name_prefix": "", 40 | "gap_file": "gap.xml", 41 | "verbosity": "NORMAL", 42 | "template_file": "", 43 | "sparsify_only_no_fit": "F", 44 | "e0": "0.0", 45 | "local_property0": "0.0", 46 | "e0_offset": "0.0", 47 | "e0_method": "isolated", 48 | "default_sigma": [0.002,0.2,0.2,0.0], # Must be parsed as a list. 49 | "sparse_jitter": "1.0e-8", 50 | "hessian_delta": "1.0e-2", 51 | "config_type_kernel_regularisation": "", 52 | "config_type_sigma energy": "", 53 | "config_type_sigma force": "", 54 | "config_type_sigma virial": "", 55 | "config_type_sigma hessian": "", 56 | "kernel_regularisation_is_per_atom": "T", 57 | "sigma_per_atom": "T", 58 | "do_copy_atoms_file": "T", 59 | "do_copy_at_file": "T", 60 | "sparse_separate_file": "T", 61 | "sparse_use_actual_gpcov": "F", 62 | "rnd_seed": "1", 63 | "openmp_chunk_size": "10000", 64 | "do_ip_timing": "F" 65 | } -------------------------------------------------------------------------------- /examples/xpot-v1.2/snap_input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: fitsnap3 4 | project_name: opt_SNAP 5 | sweep_name: test_SNAP 6 | error_method: rmse 7 | training_data: "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ/Displaced_A15.xyz" 8 | validation_data: "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ/Elastic_BCC.xyz" 9 | alpha: 0.5, 10 | }, 11 | "[BISPECTRUM]": { 12 | "numTypes" : 1, 13 | twojmax : 6 14 | "rcutfac" : "skopt.space.Real(4,6)" 15 | "rfac0" : 0.99363 16 | "rmin0" : 0.0 17 | "wj" : 1.0 18 | "radelem" : 0.5 19 | "type" : "Ta" 20 | "wselfallflag" : 0 21 | "chemflag" : 0 22 | "bzeroflag" : 0 23 | "quadraticflag" : 0 24 | }, 25 | "[CALCULATOR]":{ 26 | "calculator" : LAMMPSSNAP 27 | "energy" : 1 28 | "force" : 1 29 | "stress" : 1 30 | }, 31 | "[ESHIFT]": { 32 | "Ta" : 0.0 33 | }, 34 | "[SOLVER]":{ 35 | solver : SVD 36 | compute_testerrs : 1 37 | detailed_errors : 1 38 | }, 39 | "[SCRAPER]":{ 40 | "scraper" : "XYZ" 41 | }, 42 | "[PATH]": { 43 | "dataPath": "/u/vld/scat7402/Documents/xpot-v2/examples/snap_Ta_XYZ" 44 | }, 45 | "[OUTFILE]": { 46 | "metrics": "Ta_metrics.md" 47 | "potential": "Ta_pot" 48 | }, 49 | "[REFERENCE]": { 50 | units : metal 51 | atom_style : atomic 52 | pair_style : "hybrid/overlay zero 10.0 zbl 4.0 4.8" 53 | pair_coeff1 : "* * zero" 54 | pair_coeff2 : "* * zbl 73 73" 55 | }, 56 | "[GROUPS]": { 57 | group_sections : "name training_size testing_size eweight fweight vweight", 58 | group_types : "str float float float float float", 59 | smartweights : 0 60 | random_sampling : 0 61 | Displaced_A15 : [1.0,0.0,100,1,1.00E-08], 62 | Displaced_BCC : [1.0,0.0,100,1,1.00E-08], 63 | Displaced_FCC : [1.0,0.0,100,1,1.00E-08], 64 | Elastic_BCC : [1.0,0.0,1.00E-08,1.00E-08,0.0001], 65 | Elastic_FCC : [1.0,0.0,1.00E-09,1.00E-09,1.00E-09], 66 | GSF_110 : [1.0,0.0,100,1,1.00E-08], 67 | GSF_112 : [1.0,0.0,100,1,1.00E-08], 68 | Liquid : [1.0,0.0,4.67E+02,1,1.00E-08], 69 | Surface : [1.0,0.0,100,1,1.00E-08], 70 | Volume_A15 : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 71 | Volume_BCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 72 | Volume_FCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 73 | }, 74 | "[EXTRAS]": { 75 | dump_descriptors : 1 76 | dump_truth : 1 77 | dump_weights : 1 78 | dump_dataframe : 1 79 | }, 80 | "[MEMORY]": { 81 | "override" : 0 82 | }, 83 | 84 | } 85 | -------------------------------------------------------------------------------- /examples/xpot-v1.2/snap_optimise.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "!export PYTHONPATH=/u/vld/scat7402/software/FitSNAP:$PYTHONPATH" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "from xpot.models import SNAP\n", 19 | "\n", 20 | "mlip = SNAP(\"/u/vld/scat7402/Documents/xpot-v2/examples/snap_input.hjson\")" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "from xpot.optimiser import NamedOptimiser\n", 30 | "\n", 31 | "kwargs = {\n", 32 | " \"n_initial_points\": 5,\n", 33 | " }\n", 34 | "\n", 35 | "opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs)" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "n_calls = 10\n", 45 | "\n", 46 | "while opt.iter <= n_calls:\n", 47 | " opt.run_optimisation(mlip.fit, path = mlip.sweep_path)" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [ 56 | "opt.tabulate_final_results(mlip.sweep_path)" 57 | ] 58 | } 59 | ], 60 | "metadata": { 61 | "kernelspec": { 62 | "display_name": "xpot-dev", 63 | "language": "python", 64 | "name": "python3" 65 | }, 66 | "language_info": { 67 | "codemirror_mode": { 68 | "name": "ipython", 69 | "version": 3 70 | }, 71 | "file_extension": ".py", 72 | "mimetype": "text/x-python", 73 | "name": "python", 74 | "nbconvert_exporter": "python", 75 | "pygments_lexer": "ipython3", 76 | "version": "3.10.13" 77 | } 78 | }, 79 | "nbformat": 4, 80 | "nbformat_minor": 2 81 | } 82 | -------------------------------------------------------------------------------- /examples/xpot-v1.2/snap_optimise.py: -------------------------------------------------------------------------------- 1 | from xpot.optimiser import NamedOptimiser 2 | from xpot.snap import SNAP 3 | 4 | mlip = SNAP("/u/vld/scat7402/Documents/xpot-v2/examples/snap_input.hjson") 5 | 6 | kwargs = { 7 | "n_initial_points": 5, 8 | } 9 | 10 | opt = NamedOptimiser(mlip.optimisation_space, mlip.sweep_path, kwargs) 11 | n_calls = 10 12 | 13 | while opt.iter <= n_calls: 14 | opt.run_optimisation(mlip.fit, path=mlip.sweep_path) 15 | 16 | opt.tabulate_final_results(mlip.sweep_path) 17 | -------------------------------------------------------------------------------- /images/xpot-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/images/xpot-logo.png -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/SNAP/j3_l_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: l_2j6_gap17 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | }, 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 6 16 | rcutfac: 3.7 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 0 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: l_3_gap17 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 72 | pair_coeff1: * * zero 73 | pair_coeff2: * * zbl 6 6 74 | } 75 | "[SCRAPER]":{ 76 | scraper: XYZ 77 | } 78 | "[SOLVER]":{ 79 | solver: SVD 80 | normweight: "" 81 | normratio: "0.5" 82 | detailed_errors: "1" 83 | compute_testerrs: "1" 84 | } 85 | "[EXTRAS]":{ 86 | dump_descriptors: "0" 87 | dump_truth: "0" 88 | dump_weights: "0" 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/SNAP/j4_l_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: l_2j8_gap17 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | }, 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 8 16 | rcutfac: 3.7 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 0 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | override: "0" 59 | } 60 | "[OUTFILE]":{ 61 | metrics: newsnap_metrics.md 62 | potential: l_4_gap17 63 | } 64 | "[PATH]":{ 65 | dataPath: ../../../input_data 66 | } 67 | "[REFERENCE]":{ 68 | units: metal 69 | atom_style: atomic 70 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 71 | pair_coeff1: * * zero 72 | pair_coeff2: * * zbl 6 6 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/SNAP/j5_l_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: l_2j10_gap17 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 10 16 | rcutfac: 3.7 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 0 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: l_5_gap17 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 72 | pair_coeff1: * * zero 73 | pair_coeff2: * * zbl 6 6 74 | } 75 | "[SCRAPER]":{ 76 | scraper: XYZ 77 | } 78 | "[SOLVER]":{ 79 | solver: SVD 80 | normweight: "" 81 | normratio: "0.5" 82 | detailed_errors: "1" 83 | compute_testerrs: "1" 84 | } 85 | "[EXTRAS]":{ 86 | dump_descriptors: "0" 87 | dump_truth: "0" 88 | dump_weights: "0" 89 | } 90 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/SNAP/j6_l_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: l_2j12_gap17 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 12 16 | rcutfac: 3.7 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 0 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: l_6_gap17 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 72 | pair_coeff1: * * zero 73 | pair_coeff2: * * zbl 6 6 74 | } 75 | "[SCRAPER]":{ 76 | scraper: XYZ 77 | } 78 | "[SOLVER]":{ 79 | solver: SVD 80 | normweight: "" 81 | normratio: "0.5" 82 | detailed_errors: "1" 83 | compute_testerrs: "1" 84 | } 85 | "[EXTRAS]":{ 86 | dump_descriptors: "0" 87 | dump_truth: "0" 88 | dump_weights: "0" 89 | } 90 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/qSNAP/j3_q_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | project_name: opt_SNAP 5 | sweep_name: q_2j6_gap17 6 | error_method: rmse 7 | alpha: 0.75 8 | training_data: ../../../input_data/valid/total_train.xyz 9 | validaton_data: ../../../input_data/valid/total_test.xyz 10 | } 11 | "[BISPECTRUM]":{ 12 | numTypes: 1 13 | twojmax: 6 14 | rcutfac: 3.7 15 | rfac0: skopt.space.Real(0.5,1.5) 16 | rmin0: skopt.space.Real(0,0.2) 17 | wj: 1 18 | radelem: 0.5 19 | type: C 20 | chemflag: 0 21 | bnormflag: 0 22 | wselfallflag: 0 23 | bzeroflag: 1 24 | quadraticflag: 1 25 | } 26 | "[CALCULATOR]":{ 27 | calculator: LAMMPSSNAP 28 | energy: 1 29 | force: 1 30 | stress: 0 31 | } 32 | "[ESHIFT]":{ 33 | "C":148.314002 34 | } 35 | "[GROUPS]":{ 36 | group_sections: 37 | [ 38 | name 39 | training_size 40 | testing_size 41 | eweight 42 | fweight 43 | vweight 44 | ] 45 | group_types: str float float float float float 46 | random_sampling: "0" 47 | smartweights: "0" 48 | BOLTZT: "" 49 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 50 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 51 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "split_test":"0.0 1.0 20 1 1.0E-12" 54 | } 55 | "[MEMORY]":{ 56 | memory: "" 57 | override: "0" 58 | } 59 | "[OUTFILE]":{ 60 | metrics: newsnap_metrics.md ## DO NOT CHANGE 61 | potential: q_3_gap17 62 | } 63 | "[PATH]":{ 64 | dataPath: ../../../input_data 65 | } 66 | "[REFERENCE]":{ 67 | units: metal 68 | atom_style: atomic 69 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 70 | pair_coeff1: * * zero 71 | pair_coeff2: * * zbl 6 6 72 | } 73 | "[SCRAPER]":{ 74 | scraper: XYZ 75 | } 76 | "[SOLVER]":{ 77 | solver: SVD 78 | normweight: "" 79 | normratio: "0.5" 80 | detailed_errors: "1" 81 | compute_testerrs: "1" 82 | } 83 | "[EXTRAS]":{ 84 | dump_descriptors: "0" 85 | dump_truth: "0" 86 | dump_weights: "0" 87 | } 88 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/qSNAP/j4_q_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "/u/vld/applications/lammps-installs/amd-lammps/lammps-15Sep2022/build/lmp" 5 | project_name: opt_SNAP 6 | sweep_name: q_2j8_gap17 7 | error_method: rmse 8 | alpha: 0.75 9 | training_data: ../../../input_data/valid/total_train.xyz 10 | validaton_data: ../../../input_data/valid/total_test.xyz 11 | } 12 | "[BISPECTRUM]":{ 13 | numTypes: 1 14 | twojmax: 8 15 | rcutfac: 3.7 16 | rfac0: skopt.space.Real(0.5,1.5) 17 | rmin0: skopt.space.Real(0,0.2) 18 | wj: 1 19 | radelem: 0.5 20 | type: C 21 | chemflag: 0 22 | bnormflag: 0 23 | wselfallflag: 0 24 | bzeroflag: 1 25 | quadraticflag: 1 26 | } 27 | "[CALCULATOR]":{ 28 | calculator: LAMMPSSNAP 29 | energy: 1 30 | force: 1 31 | stress: 0 32 | } 33 | "[ESHIFT]":{ 34 | "C":148.314002 35 | } 36 | "[GROUPS]":{ 37 | group_sections: 38 | [ 39 | name 40 | training_size 41 | testing_size 42 | eweight 43 | fweight 44 | vweight 45 | ] 46 | group_types: str float float float float float 47 | random_sampling: "0" 48 | smartweights: "0" 49 | BOLTZT: "" 50 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 51 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "split_test":"0.0 1.0 20 1 1.0E-12" 55 | } 56 | "[MEMORY]":{ 57 | memory: "" 58 | override: "0" 59 | } 60 | "[OUTFILE]":{ 61 | metrics: newsnap_metrics.md 62 | potential: q_4_gap17 63 | } 64 | "[PATH]":{ 65 | dataPath: ../../../input_data 66 | } 67 | "[REFERENCE]":{ 68 | units: metal 69 | atom_style: atomic 70 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 71 | pair_coeff1: * * zero 72 | pair_coeff2: * * zbl 6 6 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/qSNAP/j5_q_gap17.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: q_2j10_gap17 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]": { 14 | numTypes: 1 15 | twojmax: 10 16 | rcutfac: 3.7 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: q_5_gap17 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: hybrid/overlay zero 10.0 zbl 3.0 3.8 72 | pair_coeff1: * * zero 73 | pair_coeff2: * * zbl 6 6 74 | } 75 | "[SCRAPER]":{ 76 | scraper: XYZ 77 | } 78 | "[SOLVER]":{ 79 | solver: SVD 80 | normweight: "" 81 | normratio: "0.5" 82 | detailed_errors: "1" 83 | compute_testerrs: "1" 84 | } 85 | "[EXTRAS]":{ 86 | dump_descriptors: "0" 87 | dump_truth: "0" 88 | dump_weights: "0" 89 | } 90 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/qSNAP/j6_q_gap17_var_cut.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 6 7 | project_name: opt_SNAP 8 | sweep_name: q_2j12_gap17_rcut_free 9 | alpha: 0.60 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 12 16 | rcutfac: skopt.space.Real(3,4.8) 17 | rfac0: skopt.space.Real(0.8,1.2) 18 | rmin0: skopt.space.Real(0,0.2) 19 | wj: 1 20 | radelem: 0.5 21 | type: C 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | "C":148.314002 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 54 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 55 | "split_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: q_12_gap17_rcut 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: zero 10.0 72 | pair_coeff: * * 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/best_j5_md.in: -------------------------------------------------------------------------------- 1 | [BISPECTRUM] 2 | numTypes = 1 3 | twojmax = 10 4 | rcutfac = 3.7 5 | rfac0 = 0.9471374646844952 6 | rmin0 = 0 7 | wj = 1 8 | radelem = 0.5 9 | type = C 10 | chemflag = 0 11 | bnormflag = 0 12 | wselfallflag = 0 13 | bzeroflag = 1 14 | quadraticflag = 1 15 | [CALCULATOR] 16 | calculator = LAMMPSSNAP 17 | energy = 1 18 | force = 1 19 | stress = 0 20 | [ESHIFT] 21 | C = 148.314002 22 | [GROUPS] 23 | group_sections = name training_size testing_size eweight fweight vweight 24 | group_types = str float float float float float 25 | random_sampling = 0 26 | smartweights = 0 27 | bulk_amo_train = 1.0 0.0 10000.0 77.6565566406764 1.0E-12 28 | bulk_cryst_train = 1.0 0.0 10.0 10.930207170599706 1.0E-12 29 | cluster_train = 1.0 0.0 10.0 68.03968070650218 1.0E-12 30 | surf_amo_train = 1.0 0.0 10.0 0.1 1.0E-12 31 | split_ = 0.0 1.0 20 1 1.0E-12 32 | _random_spheres = 0.0 1.0 20 1 1.0E-12 33 | high_t_md_test = 0.0 1.0 20 1 1.0E-12 34 | [MEMORY] 35 | override = 0 36 | [OUTFILE] 37 | metrics = newsnap_metrics.md 38 | potential = C_md_q 39 | [PATH] 40 | dataPath = ../../../input_data 41 | [REFERENCE] 42 | units = metal 43 | atom_style = atomic 44 | pair_style = zero 10.0 45 | pair_coeff = * * 46 | [SCRAPER] 47 | scraper = XYZ 48 | [SOLVER] 49 | solver = SVD 50 | normratio = 0.5 51 | detailed_errors = 1 52 | compute_testerrs = 1 53 | [EXTRAS] 54 | dump_descriptors = 0 55 | dump_truth = 0 56 | dump_weights = 0 57 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/best_j5_orig.in: -------------------------------------------------------------------------------- 1 | [BISPECTRUM] 2 | numTypes = 1 3 | twojmax = 10 4 | rcutfac = 3.7 5 | rfac0 = 0.8345010739117278 6 | rmin0 = 0 7 | wj = 1 8 | radelem = 0.5 9 | type = C 10 | chemflag = 0 11 | bnormflag = 0 12 | wselfallflag = 0 13 | bzeroflag = 1 14 | quadraticflag = 1 15 | [CALCULATOR] 16 | calculator = LAMMPSSNAP 17 | energy = 1 18 | force = 1 19 | stress = 0 20 | [ESHIFT] 21 | C = 148.314002 22 | [GROUPS] 23 | group_sections = name training_size testing_size eweight fweight vweight 24 | group_types = str float float float float float 25 | random_sampling = 0 26 | smartweights = 0 27 | bulk_amo_train = 1.0 0.0 9713.104256998615 32.9378708637969 1.0E-12 28 | bulk_cryst_train = 1.0 0.0 10000.0 58.94105846800465 1.0E-12 29 | cluster_train = 1.0 0.0 10.0 6.8154609802222135 1.0E-12 30 | surf_amo_train = 1.0 0.0 10000.0 45.68248415912456 1.0E-12 31 | split_test = 0.0 1.0 20 1 1.0E-12 32 | _random_spheres = 0.0 1.0 20 1 1.0E-12 33 | high_t_md_ = 0.0 1.0 20 1 1.0E-12 34 | [MEMORY] 35 | override = 0 36 | [OUTFILE] 37 | metrics = newsnap_metrics.md 38 | potential = C_gap_q 39 | [PATH] 40 | dataPath = ../../../input_data 41 | [REFERENCE] 42 | units = metal 43 | atom_style = atomic 44 | pair_style = zero 10.0 45 | pair_coeff = * * 46 | [SCRAPER] 47 | scraper = XYZ 48 | [SOLVER] 49 | solver = SVD 50 | normratio = 0.5 51 | detailed_errors = 1 52 | compute_testerrs = 1 53 | [EXTRAS] 54 | dump_descriptors = 0 55 | dump_truth = 0 56 | dump_weights = 0 57 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/best_j5_rand.in: -------------------------------------------------------------------------------- 1 | [BISPECTRUM] 2 | numTypes = 1 3 | twojmax = 10 4 | rcutfac = 3.7 5 | rfac0 = 1.0036861098801022 6 | rmin0 = 0 7 | wj = 1 8 | radelem = 0.5 9 | type = C 10 | chemflag = 0 11 | bnormflag = 0 12 | wselfallflag = 0 13 | bzeroflag = 1 14 | quadraticflag = 1 15 | [CALCULATOR] 16 | calculator = LAMMPSSNAP 17 | energy = 1 18 | force = 1 19 | stress = 0 20 | [ESHIFT] 21 | C = 148.314002 22 | [GROUPS] 23 | group_sections = name training_size testing_size eweight fweight vweight 24 | group_types = str float float float float float 25 | random_sampling = 0 26 | smartweights = 0 27 | bulk_amo_train = 1.0 0.0 10000.0 74.6549339702283 1.0E-12 28 | bulk_cryst_train = 1.0 0.0 10.0 0.1 1.0E-12 29 | cluster_train = 1.0 0.0 5581.388453414849 0.1 1.0E-12 30 | surf_amo_train = 1.0 0.0 10.0 0.1 1.0E-12 31 | split_ = 0.0 1.0 20 1 1.0E-12 32 | test_random_spheres = 0.0 1.0 20 1 1.0E-12 33 | high_t_md_ = 0.0 1.0 20 1 1.0E-12 34 | [MEMORY] 35 | override = 0 36 | [OUTFILE] 37 | metrics = newsnap_metrics.md 38 | potential = C_random_q 39 | [PATH] 40 | dataPath = ../../../input_data 41 | [REFERENCE] 42 | units = metal 43 | atom_style = atomic 44 | pair_style = zero 10.0 45 | pair_coeff = * * 46 | [SCRAPER] 47 | scraper = XYZ 48 | [SOLVER] 49 | solver = SVD 50 | normratio = 0.5 51 | detailed_errors = 1 52 | compute_testerrs = 1 53 | [EXTRAS] 54 | dump_descriptors = 0 55 | dump_truth = 0 56 | dump_weights = 0 57 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/in_C_q_j5_md.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | project_name: opt_SNAP 6 | sweep_name: q_5_C_random_md 7 | alpha: 0.96 8 | training_data: ../../../input_data/valid/total_train.xyz 9 | validaton_data: ./test_sets/high_t_md_test.xyz 10 | } 11 | "[BISPECTRUM]":{ 12 | numTypes: 1 13 | twojmax: 10 14 | rcutfac: 3.7 15 | rfac0: skopt.space.Real(0.70,1.5) 16 | rmin0: 0 17 | wj: 1 18 | radelem: 0.5 19 | type: C 20 | chemflag: 0 21 | bnormflag: 0 22 | wselfallflag: 0 23 | bzeroflag: 1 24 | quadraticflag: 1 25 | } 26 | "[CALCULATOR]":{ 27 | calculator: LAMMPSSNAP 28 | energy: 1 29 | force: 1 30 | stress: 0 31 | } 32 | "[ESHIFT]":{ 33 | "C":148.314002 34 | } 35 | "[GROUPS]":{ 36 | group_sections: 37 | [ 38 | name 39 | training_size 40 | testing_size 41 | eweight 42 | fweight 43 | vweight 44 | ] 45 | group_types: str float float float float float 46 | random_sampling: "0" 47 | smartweights: "0" 48 | BOLTZT: "" 49 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 50 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 51 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "split_":"0.0 1.0 20 1 1.0E-12", 54 | "_random_spheres":"0.0 1.0 20 1 1.0E-12", 55 | "high_t_md_test":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: C_md_q 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: zero 10.0 72 | pair_coeff: * * 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/in_C_q_j5_orig_test.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | project_name: opt_SNAP 6 | sweep_name: q_5_C_test_gap 7 | alpha: 0.96 8 | training_data: ../../../input_data/valid/total_train.xyz 9 | validaton_data: ../../../input_data/valid/total_test.xyz 10 | } 11 | "[BISPECTRUM]":{ 12 | numTypes: 1 13 | twojmax: 10 14 | rcutfac: 3.7 15 | rfac0: skopt.space.Real(0.70,1.5) 16 | rmin0: 0 17 | wj: 1 18 | radelem: 0.5 19 | type: C 20 | chemflag: 0 21 | bnormflag: 0 22 | wselfallflag: 0 23 | bzeroflag: 1 24 | quadraticflag: 1 25 | } 26 | "[CALCULATOR]":{ 27 | calculator: LAMMPSSNAP 28 | energy: 1 29 | force: 1 30 | stress: 0 31 | } 32 | "[ESHIFT]":{ 33 | "C":148.314002 34 | } 35 | "[GROUPS]":{ 36 | group_sections: 37 | [ 38 | name 39 | training_size 40 | testing_size 41 | eweight 42 | fweight 43 | vweight 44 | ] 45 | group_types: str float float float float float 46 | random_sampling: "0" 47 | smartweights: "0" 48 | BOLTZT: "" 49 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 50 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 51 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "split_test":"0.0 1.0 20 1 1.0E-12", 54 | "_random_spheres":"0.0 1.0 20 1 1.0E-12", 55 | "high_t_md_":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: C_gap_q 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: zero 10.0 72 | pair_coeff: * * 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/C-GAP-17/test-set-opt/in_C_q_j5_random.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | project_name: opt_SNAP 6 | sweep_name: q_5_C_random 7 | alpha: 0.96 8 | training_data: ../../../input_data/valid/total_train.xyz 9 | validaton_data: ./test_sets/test_random_spheres.xyz 10 | } 11 | "[BISPECTRUM]":{ 12 | numTypes: 1 13 | twojmax: 10 14 | rcutfac: 3.7 15 | rfac0: skopt.space.Real(0.70,1.5) 16 | rmin0: 0 17 | wj: 1 18 | radelem: 0.5 19 | type: C 20 | chemflag: 0 21 | bnormflag: 0 22 | wselfallflag: 0 23 | bzeroflag: 1 24 | quadraticflag: 1 25 | } 26 | "[CALCULATOR]":{ 27 | calculator: LAMMPSSNAP 28 | energy: 1 29 | force: 1 30 | stress: 0 31 | } 32 | "[ESHIFT]":{ 33 | "C":148.314002 34 | } 35 | "[GROUPS]":{ 36 | group_sections: 37 | [ 38 | name 39 | training_size 40 | testing_size 41 | eweight 42 | fweight 43 | vweight 44 | ] 45 | group_types: str float float float float float 46 | random_sampling: "0" 47 | smartweights: "0" 48 | BOLTZT: "" 49 | "bulk_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 50 | "bulk_cryst_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 51 | "cluster_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 52 | "surf_amo_train":"1.0 0.0 skopt.space.Real(10,10000) skopt.space.Real(0.1,100) 1.0E-12", 53 | "split_":"0.0 1.0 20 1 1.0E-12", 54 | "test_random_spheres":"0.0 1.0 20 1 1.0E-12", 55 | "high_t_md_":"0.0 1.0 20 1 1.0E-12" 56 | } 57 | "[MEMORY]":{ 58 | memory: "" 59 | override: "0" 60 | } 61 | "[OUTFILE]":{ 62 | metrics: newsnap_metrics.md 63 | potential: C_random_q 64 | } 65 | "[PATH]":{ 66 | dataPath: ../../../input_data 67 | } 68 | "[REFERENCE]":{ 69 | units: metal 70 | atom_style: atomic 71 | pair_style: zero 10.0 72 | pair_coeff: * * 73 | } 74 | "[SCRAPER]":{ 75 | scraper: XYZ 76 | } 77 | "[SOLVER]":{ 78 | solver: SVD 79 | normweight: "" 80 | normratio: "0.5" 81 | detailed_errors: "1" 82 | compute_testerrs: "1" 83 | } 84 | "[EXTRAS]":{ 85 | dump_descriptors: "0" 86 | dump_truth: "0" 87 | dump_weights: "0" 88 | } 89 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/cu/in_cu_q_j6.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | project_name: opt_SNAP 6 | sweep_name: q_6_Cu_150_75 7 | alpha: 0.75 8 | training_data: ../../../input_data/valid/total_train.xyz 9 | validaton_data: ../../../input_data/valid/total_test.xyz 10 | } 11 | "[BISPECTRUM]":{ 12 | numTypes: 1 13 | twojmax: 6 14 | rcutfac: skopt.space.Real(3,6) 15 | rfac0: skopt.space.Real(0.5,1.5) 16 | rmin0: 0 17 | wj: 1 18 | radelem: 0.5 19 | type: Cu 20 | chemflag: 0 21 | bnormflag: 0 22 | wselfallflag: 0 23 | bzeroflag: 1 24 | quadraticflag: 1 25 | } 26 | "[CALCULATOR]":{ 27 | calculator: LAMMPSSNAP 28 | energy: 1 29 | force: 1 30 | stress: 0 31 | } 32 | "[ESHIFT]":{ 33 | Cu: 0 34 | } 35 | "[GROUPS]":{ 36 | group_sections: 37 | [ 38 | name 39 | training_size 40 | testing_size 41 | eweight 42 | fweight 43 | vweight 44 | ] 45 | group_types: str float float float float float 46 | random_sampling: "0" 47 | smartweights: "0" 48 | BOLTZT: "" 49 | "Cu_JCPA_training_of AIMD NVT": 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 50 | Cu_JCPA_training_cell: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 51 | Cu_JCPA_training_surface_mp: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 52 | Cu_JCPA_training_Vacancy: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 53 | Cu_JCPA_training_crystal: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 54 | "Cu_JCPA_test_of AIMD NVT": 0.0 1.0 20 1 1.0E-12 55 | Cu_JCPA_test_cell: 0.0 1.0 20 1 1.0E-12 56 | Cu_JCPA_test_surface_mp: 0.0 1.0 20 1 1.0E-12 57 | Cu_JCPA_test_Vacancy: 0.0 1.0 20 1 1.0E-12 58 | #Cu_JCPA_test_crystal: 0.0 1.0 20 1 1.0E-12 59 | } 60 | "[MEMORY]":{ 61 | memory: "" 62 | override: "0" 63 | } 64 | "[OUTFILE]":{ 65 | metrics: newsnap_metrics.md 66 | potential: q_6_Cu 67 | } 68 | "[PATH]":{ 69 | dataPath: ../../../input_data 70 | } 71 | "[REFERENCE]":{ 72 | units: metal 73 | atom_style: atomic 74 | pair_style: zero 10.0 75 | pair_coeff: * * 76 | } 77 | "[SCRAPER]":{ 78 | scraper: XYZ 79 | } 80 | "[SOLVER]":{ 81 | solver: SVD 82 | normweight: "" 83 | normratio: "0.5" 84 | detailed_errors: "1" 85 | compute_testerrs: "1" 86 | } 87 | "[EXTRAS]":{ 88 | dump_descriptors: "0" 89 | dump_truth: "0" 90 | dump_weights: "0" 91 | } 92 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/ge/in_ge_q_j6.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 32 7 | project_name: opt_SNAP 8 | sweep_name: q_6_Ge_150_rmse_85 9 | alpha: 0.85 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 6 16 | rcutfac: skopt.space.Real(3,6) 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: 0 19 | wj: 1 20 | radelem: 0.5 21 | type: Ge 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | Ge: 0 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "Ge_JCPA_training_of AIMD NVT": 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 52 | Ge_JCPA_training_cell: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 53 | Ge_JCPA_training_surface_mp: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 54 | Ge_JCPA_training_Vacancy: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 55 | "Ge_JCPA_test_of AIMD NVT": 0.0 1.0 20 1 1.0E-12 56 | Ge_JCPA_test_cell: 0.0 1.0 20 1 1.0E-12 57 | Ge_JCPA_test_surface_mp: 0.0 1.0 20 1 1.0E-12 58 | Ge_JCPA_test_Vacancy: 0.0 1.0 20 1 1.0E-12 59 | } 60 | "[MEMORY]":{ 61 | memory: "" 62 | override: "0" 63 | } 64 | "[OUTFILE]": { 65 | metrics: newsnap_metrics.md 66 | potential: q_6_Ge 67 | } 68 | "[PATH]":{ 69 | dataPath: ../../../input_data 70 | } 71 | "[REFERENCE]":{ 72 | units: metal 73 | atom_style: atomic 74 | pair_style: zero 10.0 75 | pair_coeff: * * 76 | } 77 | "[SCRAPER]":{ 78 | scraper: XYZ 79 | } 80 | "[SOLVER]":{ 81 | solver: SVD 82 | normweight: "" 83 | normratio: "0.5" 84 | detailed_errors: "1" 85 | compute_testerrs: "1" 86 | } 87 | "[EXTRAS]":{ 88 | dump_descriptors: "0" 89 | dump_truth: "0" 90 | dump_weights: "0" 91 | } 92 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/li/in_li_q_j6.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot: { 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 3 7 | project_name: opt_SNAP 8 | sweep_name: q_6_Li_150_rmse_75_32 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 6 16 | rcutfac: skopt.space.Real(3,6) 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: 0 19 | wj: 1 20 | radelem: 0.5 21 | type: Li 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | Li: 0 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "Li_JCPA_training_of AIMD NVT": 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 52 | Li_JCPA_training_cell: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 53 | Li_JCPA_training_surface_mp: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 54 | Li_JCPA_training_Vacancy: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 55 | "Li_JCPA_test_of AIMD NVT": 0.0 1.0 20 1 1.0E-12 56 | Li_JCPA_test_cell: 0.0 1.0 20 1 1.0E-12 57 | Li_JCPA_test_surface_mp: 0.0 1.0 20 1 1.0E-12 58 | Li_JCPA_test_Vacancy: 0.0 1.0 20 1 1.0E-12 59 | } 60 | "[MEMORY]":{ 61 | memory: "" 62 | override: "0" 63 | } 64 | "[OUTFILE]":{ 65 | metrics: newsnap_metrics.md 66 | potential: q_6_Li 67 | } 68 | "[PATH]":{ 69 | dataPath: ../../../input_data 70 | } 71 | "[REFERENCE]":{ 72 | units: metal 73 | atom_style: atomic 74 | pair_style: zero 10.0 75 | pair_coeff: * * 76 | } 77 | "[SCRAPER]":{ 78 | scraper: XYZ 79 | } 80 | "[SOLVER]":{ 81 | solver: SVD 82 | normweight: "" 83 | normratio: "0.5" 84 | detailed_errors: "1" 85 | compute_testerrs: "1" 86 | } 87 | "[EXTRAS]":{ 88 | dump_descriptors: "0" 89 | dump_truth: "0" 90 | dump_weights: "0" 91 | } 92 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/mo/in_mo_q_j6.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot:{ 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 42 7 | project_name: opt_SNAP 8 | sweep_name: q_6_Mo_150_rmse_loss_0_5 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 6 16 | rcutfac: skopt.space.Real(3,6) 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: 0 19 | wj: 1 20 | radelem: 0.5 21 | type: Mo 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | Mo: 0 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "Mo_JCPA_training_of AIMD NVT": 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 52 | Mo_JCPA_training_cell: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 53 | Mo_JCPA_training_surface_mp: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 54 | Mo_JCPA_training_Vacancy: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 55 | Mo_JCPA_training_crystal: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 56 | "Mo_JCPA_test_of AIMD NVT": 0.0 1.0 20 1 1.0E-12 57 | Mo_JCPA_test_cell: 0.0 1.0 20 1 1.0E-12 58 | Mo_JCPA_test_surface_mp: 0.0 1.0 20 1 1.0E-12 59 | Mo_JCPA_test_Vacancy: 0.0 1.0 20 1 1.0E-12 60 | #Mo_JCPA_test_crystal: 0.0 1.0 20 1 1.0E-12 61 | } 62 | "[MEMORY]":{ 63 | memory: "" 64 | override: "0" 65 | } 66 | "[OUTFILE]":{ 67 | metrics: newsnap_metrics.md 68 | potential: q_6_Mo 69 | } 70 | "[PATH]":{ 71 | dataPath: ../../../input_data 72 | } 73 | "[REFERENCE]":{ 74 | units: metal 75 | atom_style: atomic 76 | pair_style: zero 10.0 77 | pair_coeff: * * 78 | } 79 | "[SCRAPER]":{ 80 | scraper: XYZ 81 | } 82 | "[SOLVER]":{ 83 | solver: SVD 84 | normweight: "" 85 | normratio: "0.5" 86 | detailed_errors: "1" 87 | compute_testerrs: "1" 88 | } 89 | "[EXTRAS]":{ 90 | dump_descriptors: "0" 91 | dump_truth: "0" 92 | dump_weights: "0" 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/ni/in_ni_q_j6.hjson: -------------------------------------------------------------------------------- 1 | { 2 | xpot:{ 3 | fitting_executable: fitsnap3 4 | lammps_executable: "" 5 | base_directory: ./ 6 | atomic_numbers: 28 7 | project_name: opt_SNAP 8 | sweep_name: q_6_Ni_150_rmse_75 9 | alpha: 0.75 10 | training_data: ../../../input_data/valid/total_train.xyz 11 | validaton_data: ../../../input_data/valid/total_test.xyz 12 | } 13 | "[BISPECTRUM]":{ 14 | numTypes: 1 15 | twojmax: 6 16 | rcutfac: skopt.space.Real(3,6) 17 | rfac0: skopt.space.Real(0.5,1.5) 18 | rmin0: 0 19 | wj: 1 20 | radelem: 0.5 21 | type: Ni 22 | chemflag: 0 23 | bnormflag: 0 24 | wselfallflag: 0 25 | bzeroflag: 1 26 | quadraticflag: 1 27 | } 28 | "[CALCULATOR]":{ 29 | calculator: LAMMPSSNAP 30 | energy: 1 31 | force: 1 32 | stress: 0 33 | } 34 | "[ESHIFT]":{ 35 | Ni: 0 36 | } 37 | "[GROUPS]":{ 38 | group_sections: 39 | [ 40 | name 41 | training_size 42 | testing_size 43 | eweight 44 | fweight 45 | vweight 46 | ] 47 | group_types: str float float float float float 48 | random_sampling: "0" 49 | smartweights: "0" 50 | BOLTZT: "" 51 | "Ni_JCPA_training_of AIMD NVT": 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 52 | Ni_JCPA_training_cell: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 53 | Ni_JCPA_training_surface_mp: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 54 | Ni_JCPA_training_Vacancy: 1.0 0.0 skopt.space.Real(100,15000) skopt.space.Real(0.1,500) 1.0E-12 55 | "Ni_JCPA_test_of AIMD NVT": 0.0 1.0 20 1 1.0E-12 56 | Ni_JCPA_test_cell: 0.0 1.0 20 1 1.0E-12 57 | Ni_JCPA_test_surface_mp: 0.0 1.0 20 1 1.0E-12 58 | Ni_JCPA_test_Vacancy: 0.0 1.0 20 1 1.0E-12 59 | } 60 | "[MEMORY]":{ 61 | memory: "" 62 | override: "0" 63 | } 64 | "[OUTFILE]":{ 65 | metrics: newsnap_metrics.md 66 | potential: q_6_Ni 67 | } 68 | "[PATH]":{ 69 | dataPath: ../../../input_data 70 | } 71 | "[REFERENCE]":{ 72 | units: metal 73 | atom_style: atomic 74 | pair_style: zero 10.0 75 | pair_coeff: * * 76 | } 77 | "[SCRAPER]":{ 78 | scraper: XYZ 79 | } 80 | "[SOLVER]":{ 81 | solver: SVD 82 | normweight: "" 83 | normratio: "0.5" 84 | detailed_errors: "1" 85 | compute_testerrs: "1" 86 | } 87 | "[EXTRAS]":{ 88 | dump_descriptors: "0" 89 | dump_truth: "0" 90 | dump_weights: "0" 91 | } 92 | } -------------------------------------------------------------------------------- /paper-data/JCP-2023/Zuo_2020/py-xpot.py: -------------------------------------------------------------------------------- 1 | from xpot.transfer_funcs.optimizers import * 2 | 3 | kwargs = { 4 | "n_calls" : 150, 5 | "n_initial_points" : 32, 6 | "initial_point_generator" : "hammersly", 7 | "verbose" : True, 8 | "n_jobs" : 1 9 | } 10 | 11 | sweep_init_gp("SNAP", **kwargs) -------------------------------------------------------------------------------- /paper-data/JCTC-2024/Sb2Te3/Sb2Te3-900.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | lammps_executable: "/u/vld/applications/lammps-installs/amd-lammps/lammps-15Sep2022/build/lmp" 5 | base_directory: ./ 6 | atomic_numbers: [51,52] 7 | project_name: opt_ACE 8 | sweep_name: "4embed-sbte-900" 9 | mpi_nodes: 1 10 | mpi_cores_per_node: 1 11 | error_method: rmse 12 | error_energy_ratio: 0.4, 13 | xval_sets: 1 14 | } 15 | "cutoff": 8, 16 | "seed": 42 17 | "metadata": { 18 | "purpose": "Potential fit" 19 | }, 20 | "data": { 21 | "filename": "/u/vld/scat7402/xpop-sims/sbte-xpot-ace/input-data/train-sb-te-nodimer.pkl.gzip", 22 | "test_filename": "/u/vld/scat7402/xpop-sims/sbte-xpot-ace/input-data/test-sb-te-nodimer.pkl.gzip", 23 | #"test_size": "0.10" 24 | }, 25 | "potential": { 26 | "deltaSplineBins": 0.001, 27 | "elements": ["Sb", "Te"], 28 | "embeddings": { 29 | "ALL": { 30 | "npot": "FinnisSinclairShiftedScaled", 31 | "fs_parameters": [1,1,1,0.5,1,"skopt.space.Real(0.025,0.975)",1,"skopt.space.Real(0.025,0.976)"], 32 | "ndensity": 4, 33 | "rho_core_cut": 3000, 34 | "drho_core_cut": 500 35 | } 36 | }, 37 | "rankmax": "", 38 | "bonds": { 39 | "ALL": { 40 | "radbase": "SBessel", 41 | "radparameters": ["skopt.space.Real(1,10)"], 42 | "rcut": "skopt.space.Real(3.8,8)", 43 | "dcut": "skopt.space.Real(0.001, 1)", 44 | "r_in": "", 45 | "delta_in": "", 46 | "core-repulsion": "", 47 | "NameofCutoffFunction": "cos" 48 | } 49 | }, 50 | "functions": { 51 | "number_of_functions_per_element": 900, 52 | "ALL": { 53 | "nradmax_by_orders": [16,12,8,5,2], 54 | "lmax_by_orders": [0,8,6,3,1], 55 | "coeffs_init": "" 56 | }, 57 | "initial_potential": "" 58 | } 59 | }, 60 | "fit": { 61 | "loss": { 62 | "kappa": 0.4, 63 | "L1_coeffs": 1e-8, 64 | "L2_coeffs": 1e-8, 65 | "w0_rad": 1e-8, 66 | "w1_rad": 1e-8, 67 | "w2_rad": 1e-8, 68 | "w1_coeffs": 0, 69 | "w2_coeffs": 0, 70 | "w_orth": "" 71 | }, 72 | // "weighting": { 73 | // "type": "EnergyBasedWeightingPolicy", 74 | // "filename": "", 75 | // "nfit": 20000, 76 | // "cutoff": "", 77 | // "DEup": 1000, 78 | // "DFup": "", 79 | // "DElow": 1.0, 80 | // "DE": 1, 81 | // "DF": 1, 82 | // "wlow": "", 83 | // "energy": "convex_hull", 84 | // "reftype": "all", 85 | // "seed": 42 86 | // }, 87 | "optimizer": "BFGS", 88 | "options": "", 89 | "maxiter": 1000, 90 | "repulsion": "auto", 91 | "trainable_parameters": "ALL", 92 | "fit_cycles": "", 93 | "noise_relative_sigma":"", 94 | "noise_absolute_sigma":"", 95 | "randomize_func_coeffs": "", 96 | //"ladder_step": 1000, 97 | //"ladder_type":"power_order", 98 | "callbacks":"" 99 | }, 100 | "backend": { 101 | "evaluator": "tensorpot", 102 | "batch_size": 400, 103 | "batch_size_reduction": "True", 104 | "batch_size_reduction_factor": 2, 105 | "display_step": 100, 106 | "gpu_config": {"mem_limit": 0} 107 | } 108 | } -------------------------------------------------------------------------------- /paper-data/JCTC-2024/Si/XPOT-ACE-1.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | lammps_executable: "/u/vld/applications/lammps-installs/amd-lammps/lammps-15Sep2022/build/lmp" 5 | base_directory: ./ 6 | atomic_numbers: 14 7 | project_name: opt_ACE 8 | sweep_name: linear-6827 9 | mpi_nodes: 1 10 | mpi_cores_per_node: 1 11 | error_method: rmse 12 | alpha: 0.7, 13 | xval_sets: 1 14 | } 15 | "cutoff": 8, 16 | "seed": 42 17 | "metadata": { 18 | "purpose": "Potential fit" 19 | }, 20 | "data": { 21 | "filename": "train_data_fixed.pkl.gzip", 22 | "test_filename": "test_data_fixed.pkl.gzip", 23 | #"test_size": "0.10" 24 | }, 25 | "potential": { 26 | "deltaSplineBins": 0.001, 27 | "elements": ["Si"], 28 | "embeddings": { 29 | "ALL": { 30 | "npot": "FinnisSinclairShiftedScaled", 31 | "fs_parameters": [1,1], 32 | "ndensity": 1, 33 | "rho_core_cut": 3000, 34 | "drho_core_cut": 500 35 | } 36 | }, 37 | "rankmax": "", 38 | "bonds": { 39 | "ALL": { 40 | "radbase": "skopt.space.Categorical(['SBessel', 'ChebExpCos', 'ChebPow'])", 41 | "radparameters": ["skopt.space.Real(1,10)"], 42 | "rcut": "skopt.space.Real(5,8)", 43 | "dcut": "skopt.space.Real(0.001, 0.1)", 44 | "r_in": "", 45 | "delta_in": "", 46 | "core-repulsion": "", 47 | "NameofCutoffFunction": "cos" 48 | } 49 | }, 50 | "functions": { 51 | "number_of_functions_per_element": 6827, 52 | "ALL": { 53 | "nradmax_by_orders": [20,12,8,6,3,2,1], 54 | "lmax_by_orders": [0,7,6,4,2,1,0], 55 | "coeffs_init": "" 56 | }, 57 | "initial_potential": "" 58 | } 59 | }, 60 | "fit": { 61 | "loss": { 62 | "kappa": 0.2, 63 | "L1_coeffs": 1e-8, 64 | "L2_coeffs": 1e-8, 65 | "w0_rad": 1e-8, 66 | "w1_rad": 1e-8, 67 | "w2_rad": 1e-8, 68 | "w1_coeffs": 0, 69 | "w2_coeffs": 0, 70 | "w_orth": "" 71 | }, 72 | // "weighting": { 73 | // "type": "EnergyBasedWeightingPolicy", 74 | // "filename": "", 75 | // "nfit": 20000, 76 | // "cutoff": "", 77 | // "DEup": 1000, 78 | // "DFup": "", 79 | // "DElow": 1.0, 80 | // "DE": 1, 81 | // "DF": 1, 82 | // "wlow": "", 83 | // "energy": "convex_hull", 84 | // "reftype": "all", 85 | // "seed": 42 86 | // }, 87 | "optimizer": "BFGS", 88 | "options": "", 89 | "maxiter": 800, 90 | "repulsion": "auto", 91 | "trainable_parameters": "ALL", 92 | "fit_cycles": "", 93 | "noise_relative_sigma":"", 94 | "noise_absolute_sigma":"", 95 | "randomize_func_coeffs": "", 96 | //"ladder_step": 1000, 97 | //"ladder_type":"power_order", 98 | "callbacks":"" 99 | }, 100 | "backend": { 101 | "evaluator": "tensorpot", 102 | "batch_size": 50, 103 | "batch_size_reduction": "True", 104 | "batch_size_reduction_factor": 2, 105 | "display_step": 50, 106 | "gpu_config": {"mem_limit": 0} 107 | } 108 | } -------------------------------------------------------------------------------- /paper-data/JCTC-2024/Si/XPOT-ACE-2.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | lammps_executable: "/u/vld/applications/lammps-installs/amd-lammps/lammps-15Sep2022/build/lmp" 5 | base_directory: ./ 6 | atomic_numbers: 14 7 | project_name: opt_ACE 8 | sweep_name: quad-3000 9 | mpi_nodes: 1 10 | mpi_cores_per_node: 1 11 | error_method: rmse 12 | alpha: 0.7, 13 | xval_sets: 1 14 | } 15 | "cutoff": 8, 16 | "seed": 42 17 | "metadata": { 18 | "purpose": "Potential fit" 19 | }, 20 | "data": { 21 | "filename": "train_data_fixed.pkl.gzip", 22 | "test_filename": "test_data_fixed.pkl.gzip", 23 | #"test_size": "0.10" 24 | }, 25 | "potential": { 26 | "deltaSplineBins": 0.001, 27 | "elements": ["Si"], 28 | "embeddings": { 29 | "ALL": { 30 | "npot": "FinnisSinclairShiftedScaled", 31 | "fs_parameters": [1,1, "skopt.space.Real(0.1, 10)", "skopt.space.Real(0.101, 10)"], 32 | "ndensity": 2, 33 | "rho_core_cut": 3000, 34 | "drho_core_cut": 500 35 | } 36 | }, 37 | "rankmax": "", 38 | "bonds": { 39 | "ALL": { 40 | "radbase": "skopt.space.Categorical(['SBessel', 'ChebExpCos', 'ChebPow'])", 41 | "radparameters": ["skopt.space.Real(1,10)"], 42 | "rcut": "skopt.space.Real(5,8)", 43 | "dcut": "skopt.space.Real(0.001, 0.1)", 44 | "r_in": "", 45 | "delta_in": "", 46 | "core-repulsion": "", 47 | "NameofCutoffFunction": "cos" 48 | } 49 | }, 50 | "functions": { 51 | "number_of_functions_per_element": 3000, 52 | "ALL": { 53 | "nradmax_by_orders": [20,12,8,6,3,2,1], 54 | "lmax_by_orders": [0,7,6,4,2,1,0], 55 | "coeffs_init": "" 56 | }, 57 | "initial_potential": "" 58 | } 59 | }, 60 | "fit": { 61 | "loss": { 62 | "kappa": 0.2, 63 | "L1_coeffs": 1e-8, 64 | "L2_coeffs": 1e-8, 65 | "w0_rad": 1e-8, 66 | "w1_rad": 1e-8, 67 | "w2_rad": 1e-8, 68 | "w1_coeffs": 0, 69 | "w2_coeffs": 0, 70 | "w_orth": "" 71 | }, 72 | // "weighting": { 73 | // "type": "EnergyBasedWeightingPolicy", 74 | // "filename": "", 75 | // "nfit": 20000, 76 | // "cutoff": "", 77 | // "DEup": 1000, 78 | // "DFup": "", 79 | // "DElow": 1.0, 80 | // "DE": 1, 81 | // "DF": 1, 82 | // "wlow": "", 83 | // "energy": "convex_hull", 84 | // "reftype": "all", 85 | // "seed": 42 86 | // }, 87 | "optimizer": "BFGS", 88 | "options": "", 89 | "maxiter": 800, 90 | "repulsion": "auto", 91 | "trainable_parameters": "ALL", 92 | "fit_cycles": "", 93 | "noise_relative_sigma":"", 94 | "noise_absolute_sigma":"", 95 | "randomize_func_coeffs": "", 96 | //"ladder_step": 1000, 97 | //"ladder_type":"power_order", 98 | "callbacks":"" 99 | }, 100 | "backend": { 101 | "evaluator": "tensorpot", 102 | "batch_size": 50, 103 | "batch_size_reduction": "True", 104 | "batch_size_reduction_factor": 2, 105 | "display_step": 50, 106 | "gpu_config": {"mem_limit": 0} 107 | } 108 | } -------------------------------------------------------------------------------- /paper-data/JCTC-2024/Si/XPOT-ACE-3.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | lammps_executable: "/u/vld/applications/lammps-installs/amd-lammps/lammps-15Sep2022/build/lmp" 5 | base_directory: ./ 6 | atomic_numbers: 14 7 | project_name: opt_ACE 8 | sweep_name: "cubic-3000" 9 | mpi_nodes: 1 10 | mpi_cores_per_node: 1 11 | error_method: rmse 12 | alpha: 0.7, 13 | xval_sets: 1 14 | } 15 | "cutoff": 8, 16 | "seed": 42 17 | "metadata": { 18 | "purpose": "Potential fit" 19 | }, 20 | "data": { 21 | "filename": "train_data_fixed.pkl.gzip", 22 | "test_filename": "test_data_fixed.pkl.gzip", 23 | #"test_size": "0.10" 24 | }, 25 | "potential": { 26 | "deltaSplineBins": 0.001, 27 | "elements": ["Si"], 28 | "embeddings": { 29 | "ALL": { 30 | "npot": "FinnisSinclairShiftedScaled", 31 | "fs_parameters": [1,1, "skopt.space.Real(0.1, 10)", "skopt.space.Real(0.101, 10)", "skopt.space.Real(0.1, 10.001)", "skopt.space.Real(0.999, 10)"], 32 | "ndensity": 3, 33 | "rho_core_cut": 3000, 34 | "drho_core_cut": 500 35 | } 36 | }, 37 | "rankmax": "", 38 | "bonds": { 39 | "ALL": { 40 | "radbase": "skopt.space.Categorical(['SBessel', 'ChebExpCos', 'ChebPow'])", 41 | "radparameters": ["skopt.space.Real(1,10)"], 42 | "rcut": "skopt.space.Real(5,8)", 43 | "dcut": "skopt.space.Real(0.001, 0.1)", 44 | "r_in": "", 45 | "delta_in": "", 46 | "core-repulsion": "", 47 | "NameofCutoffFunction": "cos" 48 | } 49 | }, 50 | "functions": { 51 | "number_of_functions_per_element": 3000, 52 | "ALL": { 53 | "nradmax_by_orders": [20,12,8,6,3,2,1], 54 | "lmax_by_orders": [0,7,6,4,2,1,0], 55 | "coeffs_init": "" 56 | }, 57 | "initial_potential": "" 58 | } 59 | }, 60 | "fit": { 61 | "loss": { 62 | "kappa": 0.2, 63 | "L1_coeffs": 1e-8, 64 | "L2_coeffs": 1e-8, 65 | "w0_rad": 1e-8, 66 | "w1_rad": 1e-8, 67 | "w2_rad": 1e-8, 68 | "w1_coeffs": 0, 69 | "w2_coeffs": 0, 70 | "w_orth": "" 71 | }, 72 | // "weighting": { 73 | // "type": "EnergyBasedWeightingPolicy", 74 | // "filename": "", 75 | // "nfit": 20000, 76 | // "cutoff": "", 77 | // "DEup": 1000, 78 | // "DFup": "", 79 | // "DElow": 1.0, 80 | // "DE": 1, 81 | // "DF": 1, 82 | // "wlow": "", 83 | // "energy": "convex_hull", 84 | // "reftype": "all", 85 | // "seed": 42 86 | // }, 87 | "optimizer": "BFGS", 88 | "options": "", 89 | "maxiter": 800, 90 | "repulsion": "auto", 91 | "trainable_parameters": "ALL", 92 | "fit_cycles": "", 93 | "noise_relative_sigma":"", 94 | "noise_absolute_sigma":"", 95 | "randomize_func_coeffs": "", 96 | //"ladder_step": 1000, 97 | //"ladder_type":"power_order", 98 | "callbacks":"" 99 | }, 100 | "backend": { 101 | "evaluator": "tensorpot", 102 | "batch_size": 50, 103 | "batch_size_reduction": "True", 104 | "batch_size_reduction_factor": 2, 105 | "display_step": 50, 106 | "gpu_config": {"mem_limit": 0} 107 | } 108 | } -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "xpot" 7 | version = "0.0.0" 8 | description = "Cross-Platorm Optimser for Hyperparameter Tuning" 9 | readme = "README.md" 10 | license = { file = "LICENSE" } 11 | authors = [{name = "Daniel Thomas du Toit", email = "daniel@thomasdutoit.net"}] 12 | dependencies = [ 13 | "ase", 14 | "hjson", 15 | "joblib", 16 | "matplotlib", 17 | "numpy<2", 18 | "pandas", 19 | "PyYAML", 20 | "scikit_optimize", 21 | "tabulate", 22 | "quippy-ase", 23 | ] 24 | requires-python = ">=3.10" 25 | 26 | [project.optional-dependencies] 27 | test = ["pytest", "pytest-cov"] 28 | dev = ["notebook", "ruff"] 29 | doc = [ 30 | "sphinx", 31 | "furo", 32 | "nbsphinx", 33 | "sphinx-autobuild", 34 | "sphinxext-opengraph", 35 | "sphinx-copybutton", 36 | ] 37 | publish = ["build", "twine"] 38 | 39 | [tool.ruff] 40 | line-length = 80 41 | indent-width = 4 42 | target-version = "py310" 43 | 44 | [tool.ruff.lint] 45 | select = ["E", "F", "UP", "B", "SIM", "I"] 46 | ignore = ["SIM300", "E402", "E703", "F722", "UP037", "F821", "B018", "B905"] 47 | fixable = ["ALL"] 48 | unfixable = [] 49 | dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" 50 | 51 | [tool.ruff.format] 52 | quote-style = "double" 53 | indent-style = "space" 54 | skip-magic-trailing-comma = false 55 | line-ending = "auto" 56 | 57 | [tool.ruff.lint.pydocstyle] 58 | convention = "numpy" -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/src/.DS_Store -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # Fitting Potentials with XPOT 2 | 3 | To fit potentials with XPOT, input files for your dataset and parameters are required. In this document, we walk through the required input files, and how to optimize hyperparameters using XPOT. 4 | 5 | ## Dataset 6 | Your dataset must be in a file format that is supported by the fitting method that you are using. For GAP & SNAP, this is possible using `.xyz` files. SNAP .xyz files must use the keywords "forces" and "energy" for the forces and cell energy respectively. 7 | 8 | For GAP, the training data must be merged into a single file, for SNAP potentials we recommend splitting the data based on structure type, to allow easy optimization of structure weights in training. 9 | 10 | ## Input File (.hjson) 11 | 12 | The parameter input file is in `hjson` format. This file includes all hyperparameters for XPOT to parse when optimizing/fitting potentials. 13 | 14 | Using scikit's notation, in order to provide optimization for a parameter, you must use one of the following methods: 15 | 16 | ``` 17 | skopt.space.Integer(low, high) 18 | skopt.space.Real(low, high) 19 | skopt.space.Categorical([list]) 20 | ``` 21 | 22 | These tell XPOT that you want to optimize this parameter. All other parameters should be entered as desired for fitting, as with a normal single fit in GAP/SNAP. 23 | 24 | The .hjson file provides improved exception handling for missing commas and other formatting oversights, to reduce the likelihood of user error resulting in failure to run, as well as providing the ability to add comments to each line. 25 | 26 | ## Python Script 27 | 28 | There are examples of python run scripts in the [examples](examples) section of this directory. These should be used as described in the main documentation to fit potentials with: 29 | 30 | ``` 31 | python run_script.py input.hjson 32 | ``` 33 | 34 | To submit this job to a node on HPCs, simply run the python file within your .sh script. 35 | 36 | ## Parsing Previous Results 37 | 38 | To parse previous run results there is a function included in XPOT. The following script works well: 39 | 40 | ``` 41 | from XPOT.transfer_funcs.general import parse_previous_sweep 42 | from XPOT.transfer_funcs.optimizers import sweep_init_gp 43 | 44 | # Parse previous results 45 | results = parse_previous_sweep('previous_sweep_folder') 46 | 47 | # Initialize new sweep 48 | kwargs = { 49 | "n_calls" : 41, 50 | "n_initial_points" : 6, 51 | "initial_point_generator" : "hammersly", 52 | "n_jobs" : 1, 53 | "x0":results[0], # Parameters from the previous sweep. 54 | "y0":results[1] # Loss values from the previous sweep. 55 | } 56 | sweep_init_gp(method, **kwargs) 57 | ``` -------------------------------------------------------------------------------- /src/xpot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/src/xpot/__init__.py -------------------------------------------------------------------------------- /src/xpot/maths.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import numpy as np 4 | 5 | 6 | def get_rmse( 7 | list_in: list[float | int], 8 | ) -> float: 9 | """ 10 | Get the root mean squared error of a list of floats or integers. Used in 11 | producing error metrics from ML potential fitting method. 12 | 13 | Parameters 14 | ---------- 15 | list_in : list 16 | List of floats or integers. 17 | 18 | Returns 19 | ------- 20 | float 21 | The root mean squared error, as a float. 22 | """ 23 | return np.sqrt(np.mean([i**2 for i in list_in])) 24 | 25 | 26 | def get_mae( 27 | list_in: list[float | int], 28 | ) -> float: 29 | """ 30 | Get the mean absolute error of a list of floats or integers. Used in 31 | producing error metrics from ML potential fitting method. 32 | 33 | Parameters 34 | ---------- 35 | list_in : list 36 | List of floats or integers. 37 | 38 | Returns 39 | ------- 40 | float 41 | The mean absolute error, as a float. 42 | """ 43 | return float(np.mean(np.abs(list_in))) 44 | 45 | 46 | def scale_list_values( 47 | list_in: list[float | int], 48 | scale_list: list[float | int], 49 | n_exponent: float = 1, 50 | ) -> list[float]: 51 | """ 52 | Scale a list of floats or integers by a given factor. 53 | 54 | Parameters 55 | ---------- 56 | list_in : list 57 | List of floats or integers. 58 | scale_list : list 59 | Number of atoms for each list element. 60 | n_exponent : float, optional 61 | Exponent for scaling by number of atoms, by default 1. 62 | 63 | Returns 64 | ------- 65 | list 66 | The scaled list. 67 | """ 68 | return [i / (j**n_exponent) for i, j in zip(list_in, scale_list)] 69 | 70 | 71 | def calculate_loss( 72 | e_error: float, 73 | f_error: float, 74 | alpha: float = 0.5, 75 | ) -> float: 76 | """ 77 | Determine the loss value from the validation errors. 78 | 79 | Parameters 80 | ---------- 81 | e_error : float 82 | The overall energy error. 83 | f_error : float 84 | The overall force error. 85 | alpha : float 86 | The weighting factor for the energy error. 87 | 88 | Returns 89 | ------- 90 | float 91 | The loss value. 92 | """ 93 | 94 | return (alpha * e_error) + ((1 - alpha) * f_error) 95 | -------------------------------------------------------------------------------- /src/xpot/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .ace import PACE 2 | from .gap import GAP 3 | from .snap import SNAP 4 | 5 | __all__ = ["PACE", "GAP", "SNAP"] 6 | -------------------------------------------------------------------------------- /src/xpot/models/defaults/ace_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "cutoff": 5, 3 | "seed": 42, 4 | "metadata": { 5 | "purpose": "Potential fit" 6 | }, 7 | "data": { 8 | "filename": "input_data/training.pckl.gzip", 9 | "test_filename": "", 10 | "test_size": "" 11 | }, 12 | "potential": { 13 | "deltaSplineBins": 0.001, 14 | "element": "", 15 | "embeddings": { 16 | "definition": { 17 | "npot": "FinnisSinclairShiftedScaled", 18 | "fs_parameters": [1,1,1,0.5], 19 | "ndensity": 2, 20 | "rho_core_cut": "", 21 | "drho_core_cut": "" 22 | } 23 | }, 24 | "rankmax": "", 25 | "bonds": { 26 | "definition": { 27 | "radbase": "SBessel", 28 | "radparameters": [5.25], 29 | "rcut": 5, 30 | "dcut": 0.01, 31 | "r_in": "", 32 | "delta_in": "", 33 | "core-repulsion": "", 34 | "NameofCutoffFunction": "" 35 | } 36 | }, 37 | "functions": { 38 | "UNARY": { 39 | "nradmax_by_orders": [15,3,2,2,1], 40 | "lmax_by_orders": [0,2,2,1,1] 41 | }, 42 | "BINARY": { 43 | "nradmax_by_orders": [15,2,2,2], 44 | "lmax_by_orders": [0,2,2,1] 45 | }, 46 | "ALL": { 47 | "nradmax_by_orders": [15,2,2,2], 48 | "lmax_by_orders": [0,2,2,1] 49 | }, 50 | "initial_potential": "" 51 | } 52 | }, 53 | "fit": { 54 | "loss": { 55 | "kappa": "auto", 56 | "L1_coeffs": 0, 57 | "L2_coeffs": 0, 58 | "w0_rad": 0, 59 | "w1_rad": 0, 60 | "w2_rad": 0, 61 | "w1_coeffs": 0, 62 | "w2_coeffs": 0, 63 | "w_orth": "" 64 | }, 65 | "optimizer": "BFGS", 66 | "options": "", 67 | "maxiter": 1000, 68 | "repulsion": "", 69 | "trainable_parameters": "", 70 | "fit_cycles": "", 71 | "noise_relative_sigma":"", 72 | "noise_absolute_sigma":"", 73 | "randomize_func_coeffs": "", 74 | "ladder_step":"", 75 | "ladder_type":"", 76 | "callbacks":{} 77 | }, 78 | "backend": { 79 | "evaluator": "tensorpot", 80 | "batch_size": 50, 81 | "batch_size_reduction": "True", 82 | "batch_size_reduction_factor": 2, 83 | "display_step": 20 84 | } 85 | } -------------------------------------------------------------------------------- /src/xpot/models/defaults/gap_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "at_file": "training.extxyz", 3 | 4 | "gap": {}, 5 | "core_param_file": "", 6 | "core_ip_args": "", 7 | "energy_parameter_name": "energy", 8 | "local_property_parameter_name": "local_property", 9 | "force_parameter_name": "forces", 10 | "virial_parameter_name": "virial", 11 | "hessian_parameter_name": "hessian", 12 | "config_type_parameter_name": "config_type", 13 | "sigma_parameter_name": "sigma", 14 | "force_mask_parameter_name": "force_mask", 15 | "parameter_name_prefix": "", 16 | "gap_file": "gap.xml", 17 | "verbosity": "NORMAL", 18 | "template_file": "", 19 | "sparsify_only_no_fit": "F", 20 | "e0": "0.0", 21 | "local_property0": "0.0", 22 | "e0_offset": "0.0", 23 | "e0_method": "", 24 | "default_sigma": [0.002,0.2,0.2,0.0], 25 | "sparse_jitter": "1.0e-8", 26 | "hessian_delta": "1.0e-2", 27 | "config_type_kernel_regularisation": "", 28 | "config_type_sigma energy": "", 29 | "config_type_sigma force": "", 30 | "config_type_sigma virial": "", 31 | "config_type_sigma hessian": "", 32 | "kernel_regularisation_is_per_atom": "T", 33 | "sigma_per_atom": "T", 34 | "do_copy_atoms_file": "T", 35 | "do_copy_at_file": "T", 36 | "sparse_separate_file": "T", 37 | "sparse_use_actual_gpcov": "F", 38 | "rnd_seed": "1", 39 | "openmp_chunk_size": "1", 40 | "do_ip_timing": "F" 41 | } -------------------------------------------------------------------------------- /src/xpot/models/defaults/grace_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "cutoff": 6, 3 | "seed": 42, 4 | "metadata": { 5 | "purpose": "Potential fit" 6 | }, 7 | "data": { 8 | "filename": "", 9 | "train_size": "", 10 | "test_filename": "", 11 | "test_size": "", 12 | "reference_energy": "" 13 | }, 14 | "potential": { 15 | "preset": "FS", 16 | "initial_potential": "" 17 | }, 18 | "fit": { 19 | "loss": { 20 | "energy": { 21 | "type": "huber", 22 | "weight": 1, 23 | "delta": 0.1 24 | }, 25 | "forces": { 26 | "type": "huber", 27 | "weight": 5, 28 | "delta": 0.1 29 | }, 30 | "switch": { 31 | "after_iter": 100, 32 | "energy": {"weight": 5}, 33 | "forces": {"weight": 2} 34 | } 35 | }, 36 | "maxiter": 150, 37 | "optimizer": "Adam", 38 | "opt_params": { 39 | "learning_rate": 0.01, 40 | "amsgrad": "True", 41 | "use_ema": "True", 42 | "ema_momentum": 0.99, 43 | "weight_decay": null, 44 | "clipvalue": 1 45 | }, 46 | "batch_size": 20, 47 | "train_max_n_buckets": 10, 48 | "test_max_n_buckets": 3, 49 | "checkpoint_freq": 10, 50 | "progressbar": "True", 51 | "train_shuffle": "True", 52 | "jit_compile": "True" 53 | } 54 | } -------------------------------------------------------------------------------- /src/xpot/models/defaults/mace_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xpot-mace", 3 | "seed": 42, 4 | "train_file": "input_data/training.xyz", 5 | "valid_fraction": 0.1, 6 | "test_file": "input_data/test.xyz", 7 | "E0s": "average", 8 | "model": "ScaleShiftMACE", 9 | "hidden_irreps": "128x0e + 128x1o", 10 | "r_max": 4, 11 | "batch_size": 16, 12 | "max_num_epochs": 800, 13 | "ema": "yes", 14 | "ema_decay": 0.99, 15 | "config_type_weights": { 16 | "Default": 1.0 17 | }, 18 | "loss": "huber", 19 | "amsgrad": "yes", 20 | "restart_latest": "yes", 21 | "default_dtype": "float64" 22 | } -------------------------------------------------------------------------------- /src/xpot/models/defaults/nequip_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "run_name": "xpot-opt", 3 | "seed": 123, 4 | "dataset_seed": 456, 5 | "append": true, 6 | "default_dtype": "float64", 7 | "model_dtype": "float32", 8 | "allow_tf32": true, 9 | "r_max": 4.0, 10 | "num_layers": 4, 11 | "l_max": 2, 12 | "parity": true, 13 | "num_features": 32, 14 | "nonlinearity_type": "gate", 15 | "nonlinearity_scalars": {"e": "silu", "o": "tanh"}, 16 | "nonlinearity_gates": {"e": "silu", "o": "tanh"}, 17 | "num_basis": 8, 18 | "BesselBasis_trainable": true, 19 | "PolynomialCutoff_p": 6, 20 | "invariant_layers": 2, 21 | "invariant_neurons": 64, 22 | "avg_num_neighbors": "auto", 23 | "use_sc": true, 24 | "dataset": "ase", 25 | "key_mapping": {"E": "total_energy", "F": "forces", "R": "pos"}, 26 | "wandb": false, 27 | "verbose": "info", 28 | "log_batch_freq": 100, 29 | "log_epoch_freq": 1, 30 | "save_checkpoint_freq": -1, 31 | "save_ema_checkpoint_freq": -1, 32 | "n_train": 100, 33 | "n_val": 50, 34 | "learning_rate": 0.005, 35 | "batch_size": 5, 36 | "validation_batch_size": 10, 37 | "max_epochs": 100000, 38 | "train_val_split": "random", 39 | "shuffle": true, 40 | "metrics_key": "validation_loss", 41 | "use_ema": true, 42 | "ema_decay": 0.99, 43 | "ema_use_num_updates": true, 44 | "report_init_validation": true, 45 | "early_stopping_patiences": {"validation_loss": 50}, 46 | "early_stopping_lower_bounds": {"LR": 1e-05}, 47 | "early_stopping_upper_bounds": {"validation_loss": 10000.0}, 48 | "loss_coeffs": {"forces": 1, "total_energy": [1, "PerAtomMSELoss"]}, 49 | "metrics_components": [["forces", "mae"], ["forces", "rmse"], ["forces", "mae", {"PerSpecies": true, "report_per_component": false}], ["forces", "rmse", {"PerSpecies": true, "report_per_component": false}], ["total_energy", "rmse"], ["total_energy", "rmse", {"PerAtom": true}]], 50 | "optimizer_name": "Adam", 51 | "optimizer_amsgrad": true, 52 | "lr_scheduler_name": "ReduceLROnPlateau", 53 | "lr_scheduler_patience": 100, 54 | "lr_scheduler_factor": 0.5, 55 | "per_species_rescale_shifts": "dataset_per_atom_total_energy_mean", 56 | "per_species_rescale_scales": null 57 | } -------------------------------------------------------------------------------- /src/xpot/models/defaults/snap_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "[BISPECTRUM]": { 3 | "numTypes": "", 4 | "twojmax": "", 5 | "rcutfac": "", 6 | "rfac0": "", 7 | "rmin0": "", 8 | "wj": "", 9 | "radelem": "", 10 | "type": "", 11 | "chemflag": "0", 12 | "bnormflag": "0", 13 | "wselfallflag": "0", 14 | "bzeroflag": "0", 15 | "quadraticflag": "0" 16 | }, 17 | "[CALCULATOR]": { 18 | "calculator": "LAMMPSSNAP", 19 | "energy": "1", 20 | "force": "1", 21 | "stress": "0" 22 | }, 23 | "[ESHIFT]": {}, 24 | "[GROUPS]": { 25 | "group_sections": "", 26 | "group_types": "", 27 | "random_sampling": "0", 28 | "smartweights": "0", 29 | "BOLTZT": "" 30 | }, 31 | "[MEMORY]": { 32 | "memory": "", 33 | "override": "0" 34 | }, 35 | "[OUTFILE]": { 36 | "metrics": "newsnap_metrics.csv", 37 | "potential": "newsnap_pot" 38 | }, 39 | "[PATH]": { 40 | "dataPath": "JSON", 41 | "groupFile": "" 42 | }, 43 | "[REFERENCE]": { 44 | "units": "metal", 45 | "atom_style": "atomic" 46 | }, 47 | "[SCRAPER]": { 48 | "scraper": "JSON" 49 | }, 50 | "[SOLVER]": { 51 | "solver": "SVD", 52 | "normweight": "", 53 | "normratio": "0.5", 54 | "detailed_errors": "1", 55 | "compute_testerrs": "0" 56 | }, 57 | "[EXTRAS]": { 58 | "dump_descriptors": "0", 59 | "dump_truth": "0", 60 | "dump_weights": "0" 61 | }, 62 | "[PYTORCH]": {} 63 | } -------------------------------------------------------------------------------- /src/xpot/workflows.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import math 4 | import time 5 | from collections.abc import Callable 6 | 7 | import xpot.loaders as load 8 | from xpot.models import * 9 | from xpot.optimiser import NamedOptimiser 10 | 11 | 12 | def optimise( 13 | mlip: Callable, 14 | input_file: str, 15 | kwargs: dict[str, str | int | float], 16 | max_iter: int = 32, 17 | min_loss: float = 0, 18 | time_limit: float = math.inf, 19 | ) -> None: 20 | """ 21 | Single function to run full optimization of an MLIP. This function contains 22 | the full workflow detailed in the XPOT documentation notebooks for 23 | optimizing MLIPs. 24 | 25 | Parameters 26 | ---------- 27 | mlip : object 28 | The MLIP class to optimize 29 | input_file : str 30 | Path to the input file containing hyperparameters for XPOT and MLIP 31 | kwargs : dict 32 | Dictionary of scikit-optimize keyword arguments to pass to the 33 | NamedOptimiser class 34 | max_iter : int, optional 35 | Maximum number of iterations to run, by default 32 36 | min_loss : float, optional 37 | Minimum loss to stop optimization, by default 0 (disabled) 38 | time_limit : float, optional 39 | Time limit for optimization in minutes, by default 0 (disabled) 40 | 41 | Returns 42 | ------- 43 | None 44 | """ 45 | mlip_obj = mlip(input_file) 46 | 47 | opt = NamedOptimiser( 48 | mlip_obj.optimisation_space, 49 | mlip_obj.sweep_path, 50 | kwargs, 51 | ) 52 | start = time.time() 53 | 54 | # convert time to seconds 55 | time_limit = time_limit * 60 56 | loss = math.inf 57 | elapsed = 0 58 | 59 | while opt.iter <= max_iter or loss >= min_loss or elapsed <= time_limit: 60 | # run optimization iteration and return loss 61 | loss = opt.run_optimisation(mlip_obj.fit, path=mlip_obj.sweep_path) 62 | 63 | # update elapsed time 64 | elapsed = time.time() - start 65 | 66 | opt.tabulate_final_results(mlip_obj.sweep_path) 67 | 68 | print( 69 | "Optimization Finalized. Results saved in" 70 | + mlip_obj.sweep_path 71 | + ". Exiting..." 72 | ) 73 | 74 | 75 | def single_fit( 76 | mlip: Callable, input_file: str, autoplex: bool = False 77 | ) -> None | tuple[float, float, float]: 78 | """ 79 | Single function to run a single fit of an MLIP. This function contains 80 | the full workflow detailed in the XPOT documentation notebooks for 81 | optimizing MLIPs. This workflow is also autoplex compatible, enabling 82 | the PACE fitting process. 83 | 84 | Parameters 85 | ---------- 86 | mlip : object 87 | The MLIP class to optimize 88 | input_file : str 89 | Path to the input file containing hyperparameters for XPOT and MLIP 90 | 91 | Returns 92 | ------- 93 | None | tuple 94 | If autoplex is True, returns a tuple containing the loss, train E error, 95 | and test E error. These errors are returned depending on the metric 96 | requested during teh fitting. If autoplex is False, returns None. 97 | """ 98 | mlip_obj = mlip(input_file) 99 | load.initialise_csvs( 100 | mlip_obj.sweep_path, mlip_obj.optimisation_space.keys() 101 | ) 102 | path = mlip_obj.sweep_path 103 | loss = mlip_obj.fit(mlip_obj.optimisation_space, 0) 104 | 105 | print( 106 | "Optimization Finalized. Results saved in" 107 | + mlip_obj.sweep_path 108 | + ". Exiting..." 109 | ) 110 | if autoplex: 111 | output = load.autoplex_return(path, single=True, single_loss=loss) 112 | return output 113 | -------------------------------------------------------------------------------- /tests/inputs/defaults.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "cutoff": 5, 4 | "seed": 42, 5 | "heinousness": "high", 6 | "rand_list": [1, 2, 3] 7 | } -------------------------------------------------------------------------------- /tests/inputs/hypers.hjson: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "seed": skopt.space.Integer(1,10) 4 | heinousness: "low" 5 | rand_list: [1, 2, 4] 6 | } -------------------------------------------------------------------------------- /tests/inputs/mace-test.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 10.0" Properties=species:S:1:pos:R:3:qm_forces:R:3 config_type=dimer qm_energy=-2.4 pbc="T T T" 3 | Si 0.00000000 0.00000000 0.00000000 0.00000000 -1.00000000 0.00000000 4 | Si 0.00000000 6.00000000 0.00000000 0.00000000 1.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /tests/inputs/mace-train.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 3 | Si 0.000000 0.000000 0.000000 0 -1 0 4 | Si 0.000000 5.000000 0.000000 0 1 0 5 | 2 6 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 7 | Si 0.000000 0.000000 0.000000 0 -1 0 8 | Si 0.000000 6.000000 0.000000 0 1 0 9 | 2 10 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 11 | Si 0.000000 0.000000 0.000000 0 -1 0 12 | Si 0.000000 5.100000 0.000000 0 1 0 13 | 2 14 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 15 | Si 0.000000 0.000000 0.000000 0 -1 0 16 | Si 0.000000 6.100000 0.000000 0 1 0 17 | 2 18 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 19 | Si 0.000000 0.000000 0.000000 0 -1 0 20 | Si 0.000000 5.200000 0.000000 0 1 0 21 | 2 22 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:qm_forces:R:3 qm_energy=-2.4 config_type=dimer pbc="T T T" 23 | Si 0.000000 0.000000 0.000000 0 -1 0 24 | Si 0.000000 6.200000 0.000000 0 1 0 -------------------------------------------------------------------------------- /tests/inputs/nequip-train.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 3 | Si 0.000000 0.000000 0.000000 0 -1 0 4 | Si 0.000000 5.000000 0.000000 0 1 0 5 | 2 6 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 7 | Si 0.000000 0.000000 0.000000 0 -1 0 8 | Si 0.000000 6.000000 0.000000 0 1 0 9 | 2 10 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 11 | Si 0.000000 0.000000 0.000000 0 -1 0 12 | Si 0.000000 5.100000 0.000000 0 1 0 13 | 2 14 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 15 | Si 0.000000 0.000000 0.000000 0 -1 0 16 | Si 0.000000 6.100000 0.000000 0 1 0 17 | 2 18 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 19 | Si 0.000000 0.000000 0.000000 0 -1 0 20 | Si 0.000000 5.200000 0.000000 0 1 0 21 | 2 22 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 23 | Si 0.000000 0.000000 0.000000 0 -1 0 24 | Si 0.000000 6.200000 0.000000 0 1 0 -------------------------------------------------------------------------------- /tests/inputs/nequip-train.xyz.idx: -------------------------------------------------------------------------------- 1 | 6 2 | 0 2 3 | 208 2 4 | 416 2 5 | 624 2 6 | 832 2 7 | 1040 2 8 | 1247 2 9 | -------------------------------------------------------------------------------- /tests/inputs/test-test.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 10.0" Properties=species:S:1:pos:R:3:forces:R:3 config_type=dimer energy=-2.4 pbc="T T T" 3 | Si 0.00000000 0.00000000 0.00000000 0.00000000 -1.00000000 0.00000000 4 | Si 0.00000000 6.00000000 0.00000000 0.00000000 1.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /tests/inputs/test-test.xyz.idx: -------------------------------------------------------------------------------- 1 | 1 2 | 0 2 3 | 345 2 4 | -------------------------------------------------------------------------------- /tests/inputs/test-test.xyz.pkl.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/tests/inputs/test-test.xyz.pkl.gzip -------------------------------------------------------------------------------- /tests/inputs/test.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=0.5 config_type=isolated pbc="T T T" 3 | Si 0.000000 0.000000 0.000000 0 0 0 4 | 2 5 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 6 | Si 0.000000 0.000000 0.000000 0 -1 0 7 | Si 0.000000 5.000000 0.000000 0 1 0 8 | 2 9 | Lattice="10 0.00 0.00 0.00 10 0.00 0.00 0.00 10" Properties=species:S:1:pos:R:3:forces:R:3 energy=-2.4 config_type=dimer pbc="T T T" 10 | Si 0.000000 0.000000 0.000000 0 -1 0 11 | Si 0.000000 6.000000 0.000000 0 1 0 -------------------------------------------------------------------------------- /tests/inputs/test.xyz.pkl.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/tests/inputs/test.xyz.pkl.gzip -------------------------------------------------------------------------------- /tests/inputs/train-test.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 10.0" Properties=species:S:1:pos:R:3:forces:R:3 config_type=isolated energy=0.5 pbc="T T T" 3 | Si 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 4 | 2 5 | Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 10.0" Properties=species:S:1:pos:R:3:forces:R:3 config_type=dimer energy=-2.4 pbc="T T T" 6 | Si 0.00000000 0.00000000 0.00000000 0.00000000 -1.00000000 0.00000000 7 | Si 0.00000000 5.00000000 0.00000000 0.00000000 1.00000000 0.00000000 8 | -------------------------------------------------------------------------------- /tests/inputs/train-test.xyz.idx: -------------------------------------------------------------------------------- 1 | 2 2 | 0 1 3 | 242 2 4 | 587 2 5 | -------------------------------------------------------------------------------- /tests/inputs/train-test.xyz.pkl.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dft-dutoit/XPOT/fcd88b97427460f6228c148f5ee909acec533bd3/tests/inputs/train-test.xyz.pkl.gzip -------------------------------------------------------------------------------- /tests/mock_runs/atomistic_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | 1,2,93,20,97 3 | 2,0.5,11,20,30 4 | 3,1.7,74,20,70 5 | 4,1.1,42,10,84 6 | 5,0.9,30,12,92 7 | 6,0.8,10.,24,109 8 | 7,0.8,10,24,109 9 | 8,0.7,8,24,115 10 | 9,0.7,9,18,104 11 | 10,0.3,8,23,29 -------------------------------------------------------------------------------- /tests/mock_runs/loss_function_errors.csv: -------------------------------------------------------------------------------- 1 | Iteration,Train Δ Energy,Test Δ Energy,Train Δ Force,Test Δ Force 2 | 1,2,52,234,43 3 | 2,0.5,11,20,30 4 | 3,1.65,74,20,70 5 | 4,1.1,42,65,84 6 | 5,0.9,23,12,92 7 | 6,0.23,10.,24,43 8 | 7,0.8,10,24,109 9 | 8,0.7,8,24,115 10 | 9,0.7,45,18,104 11 | 10,0.3,8,45,29 -------------------------------------------------------------------------------- /tests/mock_runs/parameters.csv: -------------------------------------------------------------------------------- 1 | iteration,loss,cutoff 2 | 1,10,6.38 3 | 2,9,4.55 4 | 3,36,6.33 5 | 4,22,5.79 6 | 5,17,5.33 7 | 6,5,4.0 8 | 7,6,4.0 9 | 8,4,4.19 10 | 9,6,4.15 11 | 10,2,4.18 -------------------------------------------------------------------------------- /tests/mock_runs/test_models/ace-input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: pacemaker 4 | project_name: tests/mock_runs/test_models 5 | sweep_name: ace 6 | error_method: rmse 7 | alpha: 0.5, 8 | } 9 | "cutoff": 10, 10 | "seed": 42 11 | "metadata": { 12 | "purpose": "Potential fit" 13 | }, 14 | "data": { 15 | "datapath": ../../../../inputs 16 | "filename": "train-test.xyz.pkl.gzip", 17 | "test_filename": "test-test.xyz.pkl.gzip", 18 | }, 19 | "potential": { 20 | "deltaSplineBins": 0.001, 21 | "elements": ["Cu"], 22 | "embeddings": { 23 | "ALL": { 24 | "npot": "FinnisSinclairShiftedScaled", 25 | "fs_parameters": [1,1,1,"skopt.space.Real(0.1, 2)"], 26 | "ndensity": 2, 27 | "rho_core_cut": 3000, 28 | "drho_core_cut": 500 29 | } 30 | }, 31 | "rankmax": "", 32 | "bonds": { 33 | "ALL": { 34 | "radbase": "SBessel", 35 | "radparameters": [6.25], 36 | "rcut": 10, 37 | "dcut": 0.01, 38 | "r_in": "", 39 | "delta_in": "", 40 | "core-repulsion": "", 41 | "NameofCutoffFunction": "cos" 42 | } 43 | }, 44 | "functions": { 45 | "number_of_functions_per_element": 5, 46 | "ALL": { 47 | "nradmax_by_orders": [15,6,4,3,2,2], 48 | "lmax_by_orders": [0,4,3,2,1,0], 49 | "coeffs_init": "" 50 | }, 51 | "initial_potential": "" 52 | } 53 | }, 54 | "fit": { 55 | "loss": { 56 | "kappa": "auto", 57 | "L1_coeffs": 1e-8, 58 | "L2_coeffs": 1e-8, 59 | "w0_rad": 1e-8, 60 | "w1_rad": 1e-8, 61 | "w2_rad": 1e-8, 62 | "w1_coeffs": 0, 63 | "w2_coeffs": 0, 64 | "w_orth": "" 65 | }, 66 | "optimizer": "BFGS", 67 | "maxiter": 1, 68 | "repulsion": "auto", 69 | "trainable_parameters": "ALL", 70 | }, 71 | "backend": { 72 | "evaluator": "tensorpot", 73 | "batch_size": 50, 74 | "batch_size_reduction": "True", 75 | "batch_size_reduction_factor": 2, 76 | "display_step": 50, 77 | "gpu_config": {"mem_limit": 0} 78 | } 79 | } -------------------------------------------------------------------------------- /tests/mock_runs/test_models/gap-input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: gap_fit 4 | project_name: tests/mock_runs/test_models 5 | sweep_name: gap 6 | error_method: rmse 7 | validation_data: "../../../../inputs/test-test.xyz" 8 | alpha: 0.5, 9 | }, 10 | 11 | "at_file": "../../../../inputs/train-test.xyz", 12 | 13 | "gap": { 14 | "distance_Nb": { 15 | "order": 2, 16 | "f0": 0.0, 17 | "cutoff": "skopt.space.Real(8,10)", 18 | "n_sparse": 2, 19 | "delta": 2.0, 20 | "config_type_n_sparse": "", 21 | "sparse_method": "random", 22 | "mark_sparse_atoms": "F", 23 | "add_species": "T", 24 | "covariance_type": "gaussian", 25 | "theta_uniform": 1.0, 26 | } 27 | }, 28 | 29 | "core_param_file": "", 30 | "core_ip_args": "", 31 | "energy_parameter_name": "energy", 32 | "local_property_parameter_name": "local_property", 33 | "force_parameter_name": "forces", 34 | "virial_parameter_name": "", 35 | "hessian_parameter_name": "", 36 | "config_type_parameter_name": "config_type", 37 | "sigma_parameter_name": "sigma", 38 | "force_mask_parameter_name": "force_mask", 39 | "parameter_name_prefix": "", 40 | "gap_file": "gap.xml", 41 | "verbosity": "NORMAL", 42 | "template_file": "", 43 | "sparsify_only_no_fit": "F", 44 | "e0_method": "isolated", 45 | "local_property0": 0.0, 46 | "default_sigma": [0.002,0.2,0.0,0.0], # Must be parsed as a list. 47 | "sparse_jitter": "1.0e-8", 48 | "hessian_delta": "1.0e-2", 49 | "config_type_kernel_regularisation": "", 50 | "config_type_sigma energy": "", 51 | "config_type_sigma force": "", 52 | "config_type_sigma virial": "", 53 | "config_type_sigma hessian": "", 54 | "kernel_regularisation_is_per_atom": "T", 55 | "sigma_per_atom": "T", 56 | "do_copy_atoms_file": "T", 57 | "do_copy_at_file": "T", 58 | "sparse_separate_file": "T", 59 | "sparse_use_actual_gpcov": "F", 60 | "rnd_seed": "1", 61 | "openmp_chunk_size": "10000", 62 | "do_ip_timing": "F" 63 | } -------------------------------------------------------------------------------- /tests/mock_runs/test_models/mace-input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | project_name: tests/mock_runs/test_models 4 | sweep_name: mace 5 | error_method: rmse 6 | alpha: 0.5, 7 | }, 8 | "name": test-mace 9 | "seed": 42, 10 | "train_file": "../../../../inputs/mace-train.xyz", 11 | "test_file": "../../../../inputs/mace-test.xyz", 12 | "valid_fraction": 0.33, 13 | "E0s": "average", 14 | "energy_key": "qm_energy", 15 | "forces_key": "qm_forces", 16 | "model": "ScaleShiftMACE", 17 | "hidden_irreps": "1x0e + 1x1o", 18 | "r_max": 10, 19 | "batch_size": "skopt.space.Integer(1,2)", 20 | "max_num_epochs": 3, 21 | "ema": "yes", 22 | "ema_decay": 0.99, 23 | "compute_stress": false, 24 | "stress_weight": 0 25 | "config_type_weights": { 26 | "Default": 1.0 27 | }, 28 | "loss": "huber", 29 | "amsgrad": "yes", 30 | "device": "cpu" 31 | "default_dtype": "float32" 32 | 33 | } -------------------------------------------------------------------------------- /tests/mock_runs/test_models/nequip-input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | project_name: tests/mock_runs/test_models 4 | sweep_name: nequip 5 | error_method: rmse 6 | test_set_file: "../../../../inputs/test-test.xyz" 7 | alpha: 0.5, 8 | }, 9 | "run_name": test-nequip 10 | "seed": 42, 11 | "dataset_file_name": "../../../../inputs/nequip-train.xyz", 12 | "key_mapping": {"energy": "total_energy", "forces": "forces", "R": "pos"}, 13 | "chemical_symbols": ["Si"], 14 | "r_max": 8, 15 | "num_layers": 1, 16 | "max_epochs": "skopt.space.Integer(1,2)", 17 | "n_train": 3 18 | "n_val": 1 19 | 20 | } -------------------------------------------------------------------------------- /tests/mock_runs/test_models/snap-input.hjson: -------------------------------------------------------------------------------- 1 | { 2 | "xpot": { 3 | fitting_executable: fitsnap3 4 | project_name: tests/mock_runs/test_models 5 | sweep_name: snap 6 | error_method: rmse 7 | training_data: "../../../../inputs/train-test.xyz" 8 | validation_data: "../../../../inputs/test-test.xyz" 9 | alpha: 0.5, 10 | }, 11 | "[BISPECTRUM]": { 12 | "numTypes" : 1, 13 | twojmax : 4 14 | "rcutfac" : "skopt.space.Real(6,10)" 15 | "rfac0" : 0.99363 16 | "rmin0" : 0.0 17 | "wj" : 1.0 18 | "radelem" : 0.5 19 | "type" : "Si" 20 | "wselfallflag" : 0 21 | "chemflag" : 0 22 | "bzeroflag" : 0 23 | "quadraticflag" : 0 24 | }, 25 | "[CALCULATOR]":{ 26 | "calculator" : LAMMPSSNAP 27 | "energy" : 1 28 | "force" : 1 29 | "stress" : 0 30 | }, 31 | "[ESHIFT]": { 32 | "Ta" : 0.0 33 | }, 34 | "[SOLVER]":{ 35 | solver : SVD 36 | compute_testerrs : 1 37 | detailed_errors : 1 38 | }, 39 | "[SCRAPER]":{ 40 | "scraper" : "XYZ" 41 | }, 42 | "[PATH]": { 43 | "dataPath": "../../../../inputs" 44 | }, 45 | "[OUTFILE]": { 46 | "metrics": "snap_metrics.md" 47 | "potential": "snap" 48 | }, 49 | // "[REFERENCE]": { 50 | // units : metal 51 | // atom_style : atomic 52 | // pair_style : "hybrid/overlay zero 10.0 zbl 4.0 4.8" 53 | // pair_coeff1 : "* * zero" 54 | // pair_coeff2 : "* * zbl 73 73" 55 | // }, 56 | "[GROUPS]": { 57 | group_sections : "name training_size testing_size eweight fweight", 58 | group_types : "str float float float float float", 59 | smartweights : 0 60 | random_sampling : 0 61 | train-test : [1.0,0.0,100,1], 62 | test-test : [0.0,1.0,100,1], 63 | // Displaced_BCC : [1.0,0.0,100,1,1.00E-08], 64 | // Displaced_FCC : [1.0,0.0,100,1,1.00E-08], 65 | // Elastic_BCC : [1.0,0.0,1.00E-08,1.00E-08,0.0001], 66 | // Elastic_FCC : [1.0,0.0,1.00E-09,1.00E-09,1.00E-09], 67 | // GSF_110 : [1.0,0.0,100,1,1.00E-08], 68 | // GSF_112 : [1.0,0.0,100,1,1.00E-08], 69 | // Liquid : [1.0,0.0,4.67E+02,1,1.00E-08], 70 | // Surface : [1.0,0.0,100,1,1.00E-08], 71 | // Volume_A15 : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 72 | // Volume_BCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 73 | // Volume_FCC : [1.0,0.0,1.00E+00,1.00E-09,1.00E-09], 74 | }, 75 | "[EXTRAS]": { 76 | dump_descriptors : 1 77 | dump_truth : 1 78 | dump_weights : 1 79 | dump_dataframe : 1 80 | }, 81 | "[MEMORY]": { 82 | "override" : 0 83 | }, 84 | 85 | } 86 | -------------------------------------------------------------------------------- /tests/test_convert.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pandas as pd 4 | from xpot.convert import pkl2xyz, pot2ase_calc, split_xyz, xyz2pkl 5 | 6 | 7 | def test_data_converters(): 8 | myfile = "tests/inputs/test.xyz" 9 | 10 | xyz2pkl(myfile, ref_e={"Si": 0}) 11 | assert os.path.exists("tests/inputs/test.xyz.pkl.gzip") 12 | os.remove("tests/inputs/test.xyz.pkl.gzip") 13 | 14 | xyz2pkl(myfile) 15 | assert os.path.exists("tests/inputs/test.xyz.pkl.gzip") 16 | 17 | pkl2xyz("tests/inputs/test.xyz.pkl.gzip") 18 | assert os.path.exists("tests/inputs/test.xyz.pkl.gzip.xyz") 19 | 20 | df = pd.read_pickle("tests/inputs/test.xyz.pkl.gzip", compression="gzip") 21 | assert df["energy_corrected"].values[0] == 0.5 22 | assert df["energy_corrected"].values[1] == -2.4 23 | 24 | split_xyz("tests/inputs/test.xyz", test_frac=0.5, by_config=False) 25 | assert os.path.exists("tests/inputs/test-test.xyz") 26 | assert os.path.exists("tests/inputs/train-test.xyz") 27 | os.remove("tests/inputs/test-test.xyz") 28 | os.remove("tests/inputs/train-test.xyz") 29 | 30 | split_xyz("tests/inputs/test.xyz", test_frac=0.5, by_config=True) 31 | assert os.path.exists("tests/inputs/test-test.xyz") 32 | assert os.path.exists("tests/inputs/train-test.xyz") 33 | 34 | # split_pkl("tests/inputs/test.xyz.pkl.gzip", test_frac=0.5,by_config=False) 35 | # assert os.path.exists("tests/inputs/test-test.xyz.pkl.gzip") 36 | # assert os.path.exists("tests/inputs/train-test.xyz.pkl.gzip") 37 | 38 | xyz2pkl("tests/inputs/test-test.xyz") 39 | xyz2pkl("tests/inputs/train-test.xyz") 40 | assert os.path.exists("tests/inputs/test-test.xyz.pkl.gzip") 41 | assert os.path.exists("tests/inputs/train-test.xyz.pkl.gzip") 42 | 43 | 44 | def test_pot2ase_calc(): 45 | # TODO: Implement testing for various potential types 46 | ... 47 | -------------------------------------------------------------------------------- /tests/test_maths.py: -------------------------------------------------------------------------------- 1 | from xpot.maths import get_mae, get_rmse, scale_list_values 2 | 3 | 4 | def test_get_errors(): 5 | my_data = [4, 2, 4, 2] 6 | atoms = [2, 2, 2, 1] 7 | assert get_rmse(my_data) == 10**0.5 8 | assert get_mae(my_data) == 3.0 9 | assert scale_list_values(my_data, atoms) == [2, 1, 2, 2] 10 | -------------------------------------------------------------------------------- /tests/test_models.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | 4 | from xpot.models.ace import PACE 5 | from xpot.models.gap import GAP 6 | 7 | # from xpot.models.mace import MACE 8 | # from xpot.models.nequip import NequIP 9 | # from xpot.models.snap import SNAP 10 | from xpot.optimiser import NamedOptimiser 11 | 12 | _path = os.getcwd() 13 | 14 | 15 | def test_pace(): 16 | mlip_class = PACE("tests/mock_runs/test_models/ace-input.hjson") 17 | assert mlip_class.optimisation_space is not None 18 | assert mlip_class.sweep_path is not None 19 | optimiser = NamedOptimiser( 20 | mlip_class.optimisation_space, 21 | mlip_class.sweep_path, 22 | {"n_initial_points": 1}, 23 | ) 24 | n_calls = 2 25 | while optimiser.iter <= n_calls: 26 | optimiser.run_optimisation(mlip_class.fit, path=mlip_class.sweep_path) 27 | 28 | assert optimiser.iter == 3 29 | os.chdir(_path) 30 | shutil.rmtree(mlip_class.sweep_path) 31 | 32 | 33 | # def test_mace(): 34 | # mlip_class = MACE("tests/mock_runs/test_models/mace-input.hjson") 35 | # assert mlip_class.optimisation_space is not None 36 | # assert mlip_class.sweep_path is not None 37 | # optimiser = NamedOptimiser( 38 | # mlip_class.optimisation_space, 39 | # mlip_class.sweep_path, 40 | # {"n_initial_points": 1}, 41 | # ) 42 | # n_calls = 2 43 | # while optimiser.iter <= n_calls: 44 | # optimiser.run_optimisation(mlip_class.fit, path=mlip_class.sweep_path) 45 | 46 | # assert optimiser.iter == 3 47 | # os.chdir(_path) 48 | # shutil.rmtree(mlip_class.sweep_path) 49 | 50 | 51 | def test_gap(): 52 | mlip_class = GAP("tests/mock_runs/test_models/gap-input.hjson") 53 | assert mlip_class.optimisation_space is not None 54 | assert mlip_class.sweep_path is not None 55 | optimiser = NamedOptimiser( 56 | mlip_class.optimisation_space, 57 | mlip_class.sweep_path, 58 | {"n_initial_points": 1}, 59 | ) 60 | n_calls = 2 61 | while optimiser.iter <= n_calls: 62 | optimiser.run_optimisation(mlip_class.fit, path=mlip_class.sweep_path) 63 | 64 | assert optimiser.iter == 3 65 | os.chdir(_path) 66 | shutil.rmtree(mlip_class.sweep_path) 67 | 68 | 69 | # def test_snap(): 70 | # # TODO: Fix SNAP 'number_of_atoms' keyerror in fitSNAP3 71 | # mlip_class = SNAP("tests/mock_runs/test_models/snap-input.hjson") 72 | # assert mlip_class.optimisation_space is not None 73 | # assert mlip_class.sweep_path is not None 74 | # optimiser = NamedOptimiser( 75 | # mlip_class.optimisation_space, 76 | # mlip_class.sweep_path, 77 | # {"n_initial_points": 1}, 78 | # ) 79 | # n_calls = 2 80 | # while optimiser.iter <= n_calls: 81 | # optimiser.run_optimisation(mlip_class.fit, path=mlip_class.sweep_path) 82 | 83 | # assert optimiser.iter == 3 84 | # os.chdir(_path) 85 | 86 | 87 | # def test_nequip(): 88 | # mlip_class = NequIP("tests/mock_runs/test_models/nequip-input.hjson") 89 | # assert mlip_class.optimisation_space is not None 90 | # assert mlip_class.sweep_path is not None 91 | # optimiser = NamedOptimiser( 92 | # mlip_class.optimisation_space, 93 | # mlip_class.sweep_path, 94 | # {"n_initial_points": 1}, 95 | # ) 96 | # n_calls = 2 97 | # while optimiser.iter <= n_calls: 98 | # optimiser.run_optimisation(mlip_class.fit, path=mlip_class.sweep_path) 99 | 100 | # assert optimiser.iter == 3 101 | # os.chdir(_path) 102 | # shutil.rmtree(mlip_class.sweep_path) 103 | -------------------------------------------------------------------------------- /tests/test_optimiser.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | 4 | import skopt 5 | from xpot.optimiser import NamedOptimiser 6 | 7 | 8 | def test_ask_tell(): 9 | os.mkdir("tests/mock_runs/optimisation") 10 | my_params = { 11 | "a": skopt.space.Integer(1, 10), 12 | "b": skopt.space.Categorical(["test", "test2"]), 13 | } 14 | optimiser = NamedOptimiser( 15 | my_params, 16 | "tests/mock_runs/optimisation", 17 | {"n_initial_points": 1}, 18 | ) 19 | assert optimiser._optimisable_params == my_params 20 | assert optimiser.iter == 1 21 | assert optimiser.sweep_path == "tests/mock_runs/optimisation" 22 | 23 | new_params = optimiser.ask() 24 | assert new_params != my_params 25 | assert len(new_params) == 2 26 | assert new_params["a"] in range(1, 11) 27 | assert new_params["b"] in ["test", "test2"] 28 | 29 | shutil.rmtree("tests/mock_runs/optimisation") 30 | 31 | 32 | def test_optimisation(): 33 | mypath = "tests/mock_runs/optimisation" 34 | os.mkdir(mypath) 35 | my_params = { 36 | "a": skopt.space.Integer(1, 10), 37 | "b": skopt.space.Categorical(["test", "test2"]), 38 | } 39 | optimiser = NamedOptimiser( 40 | my_params, 41 | mypath, 42 | {"n_initial_points": 1}, 43 | ) 44 | 45 | def dummy_func(x, **args): 46 | return 0.5 47 | 48 | out = optimiser.run_optimisation(dummy_func, f"{optimiser.sweep_path}") 49 | assert out == 0.5 50 | assert optimiser.iter == 2 51 | 52 | out2 = optimiser.run_optimisation(dummy_func, f"{optimiser.sweep_path}") 53 | assert out2 == 0.5 54 | 55 | # Test plotting 56 | optimiser.plot_results(mypath) 57 | assert os.path.exists(f"{mypath}/objective.pdf") 58 | assert os.path.exists(f"{mypath}/evaluations.pdf") 59 | 60 | # Test error for missing parameters.csv 61 | params = optimiser.ask() 62 | out3 = 0.6 63 | optimiser.tell(params, out3) 64 | os.remove(f"{mypath}/parameters.csv") 65 | try: 66 | optimiser.write_param_result(mypath, 3) 67 | except FileNotFoundError: 68 | pass 69 | else: 70 | raise AssertionError( 71 | "FileNotFoundError not raised despite misssing parameters.csv" 72 | ) 73 | 74 | 75 | def test_optimiser(): 76 | # Test the correct working of the optimiser under normal circumstances 77 | mypath = "tests/mock_runs/optimisation" 78 | optimiser = NamedOptimiser( 79 | {"a": skopt.space.Integer(1, 10)}, mypath, {"n_initial_points": 1} 80 | ) 81 | optimiser.tabulate_final_results(mypath) 82 | assert os.path.exists(f"{mypath}/parameters_final") 83 | assert os.path.exists(f"{mypath}/atomistic_errors_final") 84 | assert os.path.exists(f"{mypath}/loss_function_errors_final") 85 | 86 | # Test the dumping of an optimiser object 87 | optimiser.dump_optimiser(mypath) 88 | assert os.path.exists(f"{mypath}/xpot-optimiser.pkl") 89 | 90 | # Test loading of matching optimiser object (same numer of params) 91 | optimiser._optimiser = None 92 | optimiser.load_optimiser(f"{mypath}/xpot-optimiser.pkl") 93 | assert optimiser._optimiser is not None 94 | assert len(optimiser._optimiser.space.dimensions) == 1 95 | 96 | # Test loading of non-matching optimiser object (different number of params) 97 | optimiser._optimiser = None 98 | optimiser._optimisable_params = { 99 | "a": skopt.space.Integer(1, 10), 100 | "b": skopt.space.Categorical(["test", "test2"]), 101 | } 102 | try: 103 | optimiser.load_optimiser(f"{mypath}/xpot-optimiser.pkl") 104 | except ValueError: 105 | pass 106 | else: 107 | raise AssertionError("ValueError not raised") 108 | 109 | shutil.rmtree("tests/mock_runs/optimisation") 110 | -------------------------------------------------------------------------------- /tests/test_workflows.py: -------------------------------------------------------------------------------- 1 | from xpot.workflows import optimise 2 | 3 | 4 | def test_optimise(): 5 | # TODO: Implement testing for optimise functionality 6 | # Challenges: Need to create testing without requiring the use of the 7 | # specific potential style, might need to create a dummy class. 8 | 9 | pass 10 | --------------------------------------------------------------------------------