ExternalDefinitions.py

This describe a cluster, where the system information is stored in the Genetic Algorithm

ExternalDefinitions.py, 12/04/2017, Geoffrey R Weal

This python script is designed to hold subsidery definitions used by this Genetic Algorithm.

Organisms.GA.ExternalDefinitions.AtomInClusterPosition(atom, cluster)

This definition will return true if their is an atom already at a particular position in the cluster. Prevent two atoms being in the exact same position which local optimisation techniques can not handle.

Inputs:

atom (ase.atom): The atom you want to add to the cluster, to check that atom will not be in the same position as any atom in the cluster. cluster (ase.atoms or GA.Cluster): The cluster that the atom is to be added to.

Organisms.GA.ExternalDefinitions.Exploded(cluster, max_distance_between_atoms)

This definition is designed to check to make sure a cluster has not exploded. This means that all the atoms in space are closely bound together as a nanoparticle rather than some atoms being disconnected from the majority of atoms in a cluster. This method works as follows:

  • Every atom is checked for neighbours/ other atoms it is bonded to in the cluster. The information of the neighbours of each atom are placed in a neighbour list

  • Write this later

Parameters:
  • cluster (ASE.Atoms) – the cluster to check if all clusters are attached together.

  • max_distance_between_atoms (float) – defines what the maximum length of a bond is in your cluster.

Organisms.GA.ExternalDefinitions.InclusionRadiusOfCluster(cluster)

Find the radius of a sphere that could completely enclose the cluster, with radius from the centre of mass to the most outer atom from the centre of mass.

Parameters:

cluster (ASE.Atoms) – The cluster that the user would like to find the maximum radius from the centre of mass.

Returns:

max(size): The radius of the cluster from the from the centre of mass to the most outer atom from the centre of mass (in Angstroms). This radius is for a sphere that will definitely enclose the cluster within.

Return type:

float

Organisms.GA.ExternalDefinitions.InclusionboxOfCluster(cluster)

Get the cell length for a cube box to place your cluster in.

Parameters:

cluster (ASE.Atoms) – The cluster that the user would like to find the maximum radius from the centre of mass.

Returns:

max(size): The radius of the cluster from the from the centre of mass to the most outer atom from the centre of mass (in Angstroms). This radius is for a sphere that will definitely enclose the cluster within.

Return type:

float

Organisms.GA.ExternalDefinitions.get_elemental_makeup(cluster)

This gives a list which indicates the types of elements, and the number of those elements, in the cluster

This method has been coped from the def get_elemental_makeup from class Cluster, in Cluster.py

Returns:

A list which indicates the types of elements, and the number of those elements, in the cluster

Return type:

{str: int, …} (old output was [[str.,int],…])

Organisms.GA.ExternalDefinitions.is_position_already_occupied_by_an_atom_in_Cluster(atom_position, cluster, atom_indices_to_exclude_from_comparison=[])

This method determines if two atoms occupy the same position.

Parameters:
  • atom_position ((int, int, int)) – The position of the atom, given as (x position, y position, z position).

  • cluster (GA.Cluster) – The cluster to investigate.

  • atom_indices_to_exclude_from_comparison (list of int) – list of the atom indices not to include in this analysis, THis should include the atom associated with the position list atom_position