matscipy.calculators.mcfm.qm_cluster_tools.qm_clustering_tool

Classes

QMClusteringTool([mediator, ...])

This class is responsible for carving and hydrogenating a qm cluster

class matscipy.calculators.mcfm.qm_cluster_tools.qm_clustering_tool.QMClusteringTool(mediator=None, double_bonded_atoms_list=[])

Bases: BaseQMClusterTool

This class is responsible for carving and hydrogenating a qm cluster

Methods

carve_cluster(atoms, core_qm_list[, buffer_hops])

Create a cluster with the list as core atoms, returns an ase.Atoms object

complete_aromatic_rings(atoms, buffer_list, ...)

Check if a terminal atom is not connected ot two atoms at once If it is, add it.

create_buffer_region(atoms, qm_atoms_list[, ...])

GIven a list of active QM atoms, returns a list containing buffer atoms indices

create_cluster_from_marks(atoms, select_list)

Return an ase.Atoms object containing selected atoms from a larger structure

find_neighbours(atoms, index)

Find the neighbours of atom i using self.neighbour_list returns a list of [heavy_neighbours, hydrogen_neighbours]

hydrogenate_cluster(atoms, cluster)

Add neigoburing hydrogens to a cluster composed of heavy ions The input should be a set representing heavy ions in a cluster This functions operates on sets

hydrogenate_dangling_bonds(...)

Change atoms that were cut-off into hydrogens

include_special_atom(specialAtomIndex, ...)

Add a special atom to the buffer and update indexes.

print_message(message[, limit])

Print a message if the calculators verbosity level is above the given threshold

replace_double_bond(terminal_atom_index, ...)

Replace a cut-off atom with two hydrogens

replace_single_bond(terminal_atom_index, ...)

Replace a cut-off atom with a single hydrogen

__init__(mediator=None, double_bonded_atoms_list=[])

This class is responsible for carving and hydrogenating a qm cluster

Parameters:
  • mediator (matscipy.calculators.mcfm.QMCluster) – class responsible for managing the QM clusters in the simulation

  • double_bonded_atoms_list (list) – list of doubly bonded atoms, needed for double hydrogenation.

create_buffer_region(atoms, qm_atoms_list, buffer_hops=10)

GIven a list of active QM atoms, returns a list containing buffer atoms indices

Parameters:
  • atoms (ase.Atoms) – whole structure

  • qm_atoms_list (list of ints (atomic indexes)) – List of atoms in the inner QM region

  • buffer_hops (int) – Expand the cluster by this many neighbour hops to create the buffer

Returns:

  • list of ints (atomic indexes) – buffer_list: List of atoms in the buffer region

  • list of ints (atomic indexes) – terminal_atoms: List of atoms from the buffer region that are on the verge of it

  • list of ints (atomic indexes) – cutoff_atoms_list: List of atoms that are not in the buffer but are bonded to the atoms in the buffer.

carve_cluster(atoms, core_qm_list, buffer_hops=10)

Create a cluster with the list as core atoms, returns an ase.Atoms object

Parameters:
  • atoms (ase.Atoms) – whole structure

  • core_qm_list (list of ints (atomic indexes)) – Indexes of atoms in the core QM region

  • buffer_hops (int) – Expand the cluster by this many neighbour hops to create the buffer

Returns:

atoms object representing the QM cluster including the inner region and the buffer

Return type:

ase.Atoms

hydrogenate_dangling_bonds(terminal_atoms_list, cutoff_atoms_list, atomic_cluster, atoms)

Change atoms that were cut-off into hydrogens

Parameters:
  • terminal_atoms_list (list of ints (atomic indexes)) – last atoms in the buffer region, bonded to the atoms not in the buffer

  • cutoff_atoms_list (list of ints (atomic indexes)) – atoms to be changed into hydrogen, first atoms not in the buffer

  • atomic_cluster (ase.Atoms) – QM region structure (with core and buffer atoms)

  • atoms (ase.Atoms) – whole structure

replace_single_bond(terminal_atom_index, cutoff_atom_index, atomic_cluster, atoms, atomic_positions)

Replace a cut-off atom with a single hydrogen

Parameters:
  • terminal_atoms_list (list of ints (atomic indexes)) – last atoms in the buffer region, bonded to the atoms not in the buffer

  • cutoff_atoms_list (list of ints (atomic indexes)) – atoms to be changed into hydrogen, first atoms not in the buffer

  • atomic_cluster (ase.Atoms) – QM region structure (with core and buffer atoms)

  • atoms (ase.Atoms) – whole structure

  • atomic_positions (np.array) – Positions of atoms in the whole structure (copy of the atoms.positions)

replace_double_bond(terminal_atom_index, cutoff_atom_index, atomic_cluster, atoms, atomic_positions)

Replace a cut-off atom with two hydrogens

Parameters:
  • terminal_atoms_list (list of ints (atomic indexes)) – last atoms in the buffer region, bonded to the atoms not in the buffer

  • cutoff_atoms_list (list of ints (atomic indexes)) – atoms to be changed into hydrogen, first atoms not in the buffer

  • atomic_cluster (ase.Atoms) – QM region structure (with core and buffer atoms)

  • atoms (ase.Atoms) – whole structure

  • atomic_positions (np.array) – Positions of atoms in the whole structure (copy of the atoms.positions)

include_special_atom(specialAtomIndex, atoms, buffer_list, terminal_atoms_list, cutoff_atoms_list)

Add a special atom to the buffer and update indexes. In case a group of special atoms are specified (special molecule), If one of these atoms is in the buffer regios, the rest are also added to it.

Parameters:
  • specialAtomIndex (int (atomic index)) – Add a specified atoms to the buffer

  • atoms (ase.Atoms) – whole structure

  • buffer_list (list of ints (atomic indexes)) – List of atoms in the buffer region

  • terminal_atoms_list (list of ints (atomic indexes)) – last atoms in the buffer region, bonded to the atoms not in the buffer

  • cutoff_atoms_list (list of ints (atomic indexes)) – atoms to be changed into hydrogen, first atoms not in the buffer

complete_aromatic_rings(atoms, buffer_list, terminal_atoms_list, cutoff_atoms_list, total_supplementary_terminal_atoms)

Check if a terminal atom is not connected ot two atoms at once If it is, add it. This deals with aromatic ring structures

Parameters:
  • atoms (ase.Atoms) – whole structure

  • buffer_list (list of ints (atomic indexes)) – List of atoms in the buffer region

  • terminal_atoms_list (list of ints (atomic indexes)) – last atoms in the buffer region, bonded to the atoms not in the buffer

  • cutoff_atoms_list (list of ints (atomic indexes)) – atoms to be changed into hydrogen, first atoms not in the buffer

  • total_supplementary_terminal_atoms (NONE) – atoms added to the buffer to make clusters more physical. Example: last atom in the aromnatic ring

Returns:

Return True if any atoms were added

Return type:

bool

create_cluster_from_marks(atoms, select_list)

Return an ase.Atoms object containing selected atoms from a larger structure

Parameters:
  • atoms (ase.Atoms) – whole structure

  • select_list (list of ints (atomic indexes)) – List of atoms to include in the new structure

Returns:

Structure composed of selected atoms

Return type:

ase.Atoms

print_message(message, limit=100)

Print a message if the calculators verbosity level is above the given threshold

Parameters:
  • message (str) – The message to be printed

  • limit (int) – the verbosity threshold for this mesage

find_neighbours(atoms, index)

Find the neighbours of atom i using self.neighbour_list returns a list of [heavy_neighbours, hydrogen_neighbours]

Parameters:
  • atoms (ase.Atoms object) – structure in which it is necessary to find the neighbours

  • index (int) – atomic index

Returns:

  • list – non-hydrogen neighbours

  • list – hydrogen neighbours

hydrogenate_cluster(atoms, cluster)

Add neigoburing hydrogens to a cluster composed of heavy ions The input should be a set representing heavy ions in a cluster This functions operates on sets

Parameters:
  • atoms (ase.Atoms object) – structure in which it is necessary to find the neighbours

  • cluster (ase.Atoms object) – sub-structure of the larger struct that needs its dangling bonds hydrogenated

Returns:

The original cluster but now hydrogenated

Return type:

ase.Atoms