Interpolation_Script.py - How to run NISP

In this article, we will look at how to run NISP. NISP is run through the Interpolation_Script.py python script. You can find examples of Run.py files at github.com/GardenGroupUO/NISP under Examples. Also, you can try out this program by running an example script through a Jupyter notebook. See Examples of running NISP to get access to examples of running NISP through this Jupyter notebook!

Running the Interpolation_Script.py script

We will explain how the Interpolation_Script.py code works by running though the example shown below:

Interpolation_Script.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from NISP import Run_Interpolation_Scheme 
from RunMinimisation_Au import Minimisation_Function

input_information = {}
input_information['Element Type'] = 'Au'
input_information['Cohesive Energy'] = -3.82819360826 #-3.82819360826
input_information['Maximum No. of Atoms'] = 2000
input_information['Local Optimiser'] = Minimisation_Function

output_information = {}
output_information['Plot upper No of atom limit']   = None
output_information['Plot lower No of atom limit']   = None
output_information['Plot upper delta energy limit'] = None
output_information['Plot lower delta energy limit'] = None
output_information['Sizes to obtain instructions to create clusters for'] = [561,742,923]#[37,38,44,55,147,40,888,1399]

no_of_cpus = 4
filename_prefix = ''

Run_Interpolation_Scheme(input_information=input_information,output_information=output_information,no_of_cpus=no_of_cpus,filename_prefix=filename_prefix)

Lets go through each part of the Interpolation_Script.py file one by one to understand how to use it.

1) Input information for the interpolation scheme

We first load the information required by the interpolation scheme. All this information is loaded as entries into the dictionary called input_information.

The pieces of information required in input_information are:

  • Element Type (str.): This is the type of element that the cluster is made up of.

  • Cohesive Energy (float): This is the cohesive energy of the element you are using. See How to obtain cohesive energies to find about about how to obtain cohesive energies.

  • Maximum No. of Atoms (int): The number of offspring generated per generation.

  • Local Optimiser (def/str.): This is a local optimisation method that you will locally optimise clusters with as well as their delta energies. See RunMinimisation.py - Writing a Local Minimisation Function for NISP for information about the local optimiser works and is written.

    • You can also use VASP to perform DFT local optimisations on your clusters. Do this by setting the 'Local Optimiser' in input_information as input_information['Local Optimiser'] = 'VASP'. See How to perform NISP with VASP calculations to learn more about how to perform VASP calculations on clusters created using NISP.

    • You can also select to manually enter in the energies of the clusters. To do this, enter in input_information['Local Optimiser'] = 'Manual Mode'. See How to manually enter energy results into NISP for more information about how to manually enter in energies for clusters into NISP.

An example of these parameters in Interpolation_Script.py is given below:

4
5
6
7
8
input_information = {}
input_information['Element Type'] = 'Au'
input_information['Cohesive Energy'] = -3.82819360826 #-3.82819360826
input_information['Maximum No. of Atoms'] = 2000
input_information['Local Optimiser'] = Minimisation_Function

2) Output information for the interpolation scheme

We then load the information required by the interpolation scheme to plot the results from the interpolation scheme. The sizes of all the clusters that you would like to obtain possible clusters for are also inputted here and given as txt files.

All this information is loaded as entries into the dictionary called output_information.

The pieces of information required in output_information are:

  • Plot upper No of atom limit (int): This is the upper size range that you would like to plot.

  • Plot lower No of atom limit (int): This is the lower size range that you would like to plot.

  • Plot upper delta energy limit (float): This is the upper delta energy range that you would like to plot.

  • Plot lower delta energy limit (float): This is the lower delta energy range that you would like to plot.

  • Sizes to obtain instructions to create clusters for (list of ints): These are all the sizes of clusters that you would like to obtain possible clusters for, including perfect, open-shell, and close-shell clusters. NISP will include text files that will include how to make all the symmetric and unsymmetric icosahedral, decahedral, and octahedral cluster that contain a particular cluster size.

  • Filename Prefix (str.): This is the prefix of the name that you want to give to files that are create by the NISP program. This does not need to be given, as there is a default prefix given. The default filename prefix includes the element of the cluster as well as the maximum no. of atoms that the program was run up to.

An example of these parameters in Interpolation_Script.py is given below:

10
11
12
13
14
15
output_information = {}
output_information['Plot upper No of atom limit']   = None
output_information['Plot lower No of atom limit']   = None
output_information['Plot upper delta energy limit'] = None
output_information['Plot lower delta energy limit'] = None
output_information['Sizes to obtain instructions to create clusters for'] = [561,742,923]#[37,38,44,55,147,40,888,1399]

3) The number of CPUs used by the program and the filename prefix of input and output files

NISP can run for a long time, especially if you have set Maximum No. of Atoms to over 1000 atoms. Therefore, it is possible to run this program for a while. Therefore, it is possible to parallelise this program so that it run a bit faster. This can be set by setting the no_of_cpus variable. no_of_cpus must be set to an int. The default value for the no_of_cpus variable is 1.

Furthermore, you can also give a custom name to the input and output files that you make/are made. This is given in filename_prefix. However, you do not need to do this. If you dont want to have a custom filename, do not include filename_prefix in your script or set filename_prefix = ''.

An example of no_of_cpus in Interpolation_Script.py is given below:

17
18
no_of_cpus = 4
filename_prefix = ''

Run NISP!

You have got to the end of all the parameter setting stuff. Now on to running NISP. The next part of the Interpolation_Script.py script tells NISP to run. This is written as follows in the Interpolation_Script.py:

20
Run_Interpolation_Scheme(input_information=input_information,output_information=output_information,no_of_cpus=no_of_cpus,filename_prefix=filename_prefix)

Output files that are created by NISP

The NISP program will create a number of plots and text documents when it is run. See Examples of data that the NISP program gives to see the types of plots and text documents that NISP will make.