pele.angleaxis.aatopology#

Module source

this module holds the classes applicable for working with general rigid body systems. i.e. those that do not necessarily have a representation as a set of atomistic coords. see rigidbody.py for those classes which derive from these.

pele.angleaxis.aatopology.interpolate_angleaxis()[source]

Source

def interpolate_angleaxis(initial, final, t):

interpolate between 2 arrays of angle axis coordinates

Parameters:
initial: np.array

configuration 1

final: np.array

configuration 2

t: float

interpolation parameter with t in [0,1]

class pele.angleaxis.aatopology.AASiteType[source]

Source

class AASiteType:

Definition of an angle axis site

Parameters:
Mfloat

total mass of the angle axis site

Wfloat

sum of all weights

S3x3 array

weighted tensor of gyration S_ij = sum m_i x_i x_j sn402: weighted tensor of gyration S_{lphaeta} = sum_i m_i x_{i,lpha} x_{i, eta} ?

cog3 dim np.array

center of geometry

inversion3x3 np.array

matrix which defines on how to perform an inversion which doesn’t affect the coordinates. None if no inversion can be performed. TODO : this is not implemented yet

symmetrieslist of 3x3 np.arrays

list of all symmetry operations (expressed as matrices) which can be performed on the angle axis site excluding an inversion.

Attributes:
Sm3x3 array

The tensor of gyration used to compute used to compute physical properties like normal mode vibrational frequncies. For a rigid body this is interpreted as the mass-weighted tensor of gyration.

S3x3 array

The tensor of gyration used for computing distances between angle axis sites. For a rigid body we weight all the atoms the same when computing distances.

Mfloat

The total mass of the angle axis site. Used in conjunction with Sm

Wfloat

The sum of all the weights. Used in conjunction with S.

cognp.array

center of geometry. This is used in conjunction with S. It is assumed that the center of mass, used in conjunction with Sm is at the origin.

symmetrieslist of 3x3 np.arrays

list of all symmetry operations (expressed as matrices) which can be performed on the angle axis site. Excluding inversion.

See also

RigidFragment

Notes

See Ruehle, Kusumaatmaj, Chakrabarti, and Wales http://dx.doi.org/10.1021/ct400403y

We have tried to logically separate the concept of a rigid body (a rigid collection atoms) from an angle axis site, which might describe a single atom with a dipolar interaction.

This class represents an angle axis site and is fully characterized by a tensor of gyration for the shape, and the center of geometry, which can differ from the center of mass.

The class RigidFragment inherits from this class and implements some functions which are only applicable to a collection of rigid atoms.

We have not always been successful about keeping the concepts separated. This should be improved.

AASiteType.get_smallest_rij()[source]

Source

def get_smallest_rij(self, com1, com2):

return the shortest vector from com1 to com2

AASiteType.distance_squared()[source]

Source

def distance_squared(self, com1, p1, com2, p2):

distance measure between 2 angle axis bodies of same type

Parameters:
com1:

center of mass of 1st site

p1:

angle axis vector of 1st site

com2:

center of mass of 2nd site

p2:

angle axis vector of 2nd site

sitetype: AASiteType, optional

angle axis site type with mass and moment of inertia tensor

returns:

distance squared

AASiteType.distance_squared_grad()[source]

Source

def distance_squared_grad(self, com1, p1, com2, p2):

calculate spring force between 2 sites

Parameters:
com1:

center of mass of 1st site

p1:

angle axis vector of 1st site

com2:

center of mass of 2nd site

p2:

angle axis vector of 2nd site

sitetype: AASiteType, optional

amgle axis site type with mass and moment of inertia tensor

returns: tuple

spring cart, spring rot

AASiteType.metric_tensor()[source]

Source

def metric_tensor(self, p):

calculate the mass weighted metric tensor

AASiteType.metric_tensor_cog()[source]

Source

def metric_tensor_cog(self, p):

calculate the metric tensor when for w_i != m_i

Note: js850> why is x not used in this function?

class pele.angleaxis.aatopology.AATopology[source]

Source

class AATopology:

Angle axis topology

An angle axis topology stores all topology information for an angle axis system. The AATopology is composed of several angle axis sites (AASiteType), which describe the shape of the angle axis site and each site carries a position and orientation. Therefore, the length of the coordinate array must be 6*number_of_sites.

Parameters:
sitesiteratable

list of sites in the system

Attributes:
sites

list of all sites in the system

AATopology.add_sites()[source]

Source

def add_sites(self, sites):
Add a site to the topology

Parameters
---------
sites : iteratable
    list of AASiteType
AATopology.coords_adapter()[source]

Source

def coords_adapter(self, coords=None):

Create a coords adapter to easy access coordinate array

AATopology.distance_squared()[source]

Source

def distance_squared(self, coords1, coords2):

Calculate the squared distance between 2 configurations

AATopology.distance_squared_grad()[source]

Source

def distance_squared_grad(self, coords1, coords2):

Calculate gradient with respect to coords 1 for the squared distance

AATopology.neb_distance()[source]

Source

def neb_distance(self, coords1, coords2, distance=True, grad=True):

wrapper function called by neb to get distance between 2 images

AATopology.interpolate()[source]

Source

def interpolate(self, initial, final, t):

interpolate between 2 sets of angle axis configurations

initialnp.array

initial configuration

finalnp.array

final configuration

tfloat

interpolation parameters [0,1]

AATopology.align_path()[source]

Source

def align_path(self, path):

ensure a series of images are aligned with each other

Parameters:
pathlist of arrays

This is a list of numpy array in com + angle axis format

Notes

this simply aligns the angle axis vectors

AATopology.zeroEV()[source]

Source

def zeroEV(self, x):

return a list of zero eigenvectors

This does both translational and rotational eigenvectors

AATopology.orthogopt()[source]

Source

def orthogopt(self, v, coords):

make v orthogonal to the zero eigenvectors at position coords

AATopology.metric_tensor()[source]

Source

def metric_tensor(self, coords):

get the metric tensor for a current configuration

class pele.angleaxis.aatopology.AATopologyBulk[source]

Source

class AATopologyBulk(AATopology):

Topology class for rigid body systems with periodic boundaries

Parameters:
boxvec: numpy.array

The side lengths of the periodic box

sites: list (optional)

A list of RigidFragmentBulk objects corresponding to the rigid bodies in the system

Notes

Contains functions to calculate the squared distance between two sets of com/aa coordinates, and the gradient of this distance with respect to one set of coordinates

AATopologyBulk.distance_squared()[source]

Source

def distance_squared(self, coords1, coords2):

Calculate the squared distance between 2 configurations

AATopologyBulk.distance_squared_grad()[source]

Source

def distance_squared_grad(self, coords1, coords2):

Calculate gradient with respect to coords 1 for the squared distance