.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/gap_fit.sh" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_gap_fit.sh: Fitting GAP =========== In this tutorial, you will learn to write a bash-script that fits GAP on your DFT data. GAP learns the energies and forces as a function of the atomic positions. It is implemented as a command line tool ``gap_fit`` which takes many parameters. The parameters are specified in the following, and then passed to ``gap_fit`` .. GENERATED FROM PYTHON SOURCE LINES 9-12 First, we define our parameters which we want to vary later In this case, that's the Cut-off of the atomic neighborhood, the output file and the input file. .. GENERATED FROM PYTHON SOURCE LINES 14-17 .. code-block:: Bash CUT_OFF=4.0 GAP_FILE=cut_off_4A/SOAP.xml INPUT_FILE=train.xyz .. GENERATED FROM PYTHON SOURCE LINES 18-19 Next, we have the parameters for GAP. .. GENERATED FROM PYTHON SOURCE LINES 20-20 .. code-block:: Bash GAP_PARAMS=( .. GENERATED FROM PYTHON SOURCE LINES 21-22 First, we have the parameters for the 2 body distance descriptor .. GENERATED FROM PYTHON SOURCE LINES 23-31 .. code-block:: Bash distance_2b cutoff=$CUT_OFF covariance_type=ard_se delta=1 theta_uniform=1.0 sparse_method=uniform n_sparse=300 Z1=18 Z2=18 : .. GENERATED FROM PYTHON SOURCE LINES 32-33 Then we have the parameters for the SOAP descriptor .. GENERATED FROM PYTHON SOURCE LINES 34-34 .. code-block:: Bash soap .. GENERATED FROM PYTHON SOURCE LINES 35-36 ``n_max`` and ``l_max`` is the order of expansion in spherical harmonics .. GENERATED FROM PYTHON SOURCE LINES 37-38 .. code-block:: Bash l_max=6 n_max=6 .. GENERATED FROM PYTHON SOURCE LINES 39-40 ``atom_sigma`` is the smearing of the atomic position .. GENERATED FROM PYTHON SOURCE LINES 41-42 .. code-block:: Bash atom_sigma=0.5 zeta=4 .. GENERATED FROM PYTHON SOURCE LINES 43-44 Then we specify the cut-off for the neighborhood around the centered atom .. GENERATED FROM PYTHON SOURCE LINES 45-46 .. code-block:: Bash cutoff=$CUT_OFF cutoff_transition_width=0.5 .. GENERATED FROM PYTHON SOURCE LINES 47-48 and some magic settings .. GENERATED FROM PYTHON SOURCE LINES 49-52 .. code-block:: Bash covariance_type=dot_product n_sparse=300 sparse_method=random delta=1.0 .. GENERATED FROM PYTHON SOURCE LINES 53-54 Finally, we specify the number of different species and the atomic charge number of the species .. GENERATED FROM PYTHON SOURCE LINES 55-58 .. code-block:: Bash n_Z=1 Z={18} ) .. GENERATED FROM PYTHON SOURCE LINES 59-60 Next, we have some general parameters .. GENERATED FROM PYTHON SOURCE LINES 61-63 .. code-block:: Bash GEN_PARAMS=( e0_method=average gap={"${GAP_PARAMS[@]}"} .. GENERATED FROM PYTHON SOURCE LINES 64-65 Here we specify the input file (the atomic coordinates and forces) and the output file (the machine learned potential) .. GENERATED FROM PYTHON SOURCE LINES 66-69 .. code-block:: Bash at_file=$INPUT_FILE gp_file=$GAP_FILE default_sigma={0.003 0.15 0 0} sparse_jitter=1.0e-10 .. GENERATED FROM PYTHON SOURCE LINES 70-71 and then we have some parsing options for the input file .. GENERATED FROM PYTHON SOURCE LINES 72-75 .. code-block:: Bash force_parameter_name=forces energy_parameter_name=energy ) .. GENERATED FROM PYTHON SOURCE LINES 76-77 Finally, we print our parameters and then run the gap_fit command .. GENERATED FROM PYTHON SOURCE LINES 78-81 .. code-block:: Bash echo ${GEN_PARAMS[@]} gap_fit "${GEN_PARAMS[@]}" .. GENERATED FROM PYTHON SOURCE LINES 81-83 To run this script open the terminal, navigate to the folder ``your_project/gap`` and execute the command ``bash gap_fit.sh``. .. _sphx_glr_download_auto_examples_gap_fit.sh: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Bash source code: gap_fit.sh ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: gap_fit.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_