Skip to content

Add several intrinsic properties of AMML Structure

Overview

Not implemented:

  • chemical formula (ASE: get_chemical_formula())
  • number of atoms (ASE: len(atoms)
  • cell volume (ASE: get_volume())
  • center of mass (ASE: get_center_of_mass())
  • radius of gyration (see implementation suggestion below)
  • moments of inertia (ASE: get_moments_of_inertia())
  • angular momentum (ASE: get_angular_momentum())

Already implemented:

  • kinetic_energy
  • temperature
  • distance_matrix

Details

The center_of_mass, radius_of_gyration, moments_of_inertia are currently in the rule AMMLPropertyName and supposed to be attributed to some algorithm or calculator. These have to be removed from that rule. They are attributed to structure objects instead. Also Inertia algorithm has to be removed from the list of algorithms.

The chemical composition should be accessible through ASE:

h2o_struct = ...
print(h2o.formula)
>>> 'H2O'

In addition, very useful would be to have a property to access the number of atoms. Otherwise one has to extract the atoms from structure and then take the length with len.

Additionally, there should be access to the cell volume. Otherwise it has to be computed by the user using the structure cell.

Radius of gyration:

def gyration_radius(positions):
    """ calculate radius of gyration of particles with provided positions """
    from math import sqrt
    centroid = np.mean(positions, axis=0)
    rog = sqrt(np.mean((np.linalg.norm(positions-centroid, axis=1))**2, axis=0))
    return rog
Edited by Ivan Kondov