pele.angleaxis.rigidbody#

class pele.angleaxis.rigidbody.RigidFragment[source]

Source

class RigidFragment(aatopology.AASiteType):

Defines a single rigid fragment

Attributes:
S3x3 array

weighted tensor of gyration S_ij = \sum w_i x_i x_j. This is used for computing distances between angle axis sites. We find that weighting all atoms the same (w_i = 1) gives the best distance metric.

Sm3x3 array

mass-weighted tensor of gyration S_ij = \sum m_i x_i x_j. This is used to compute physical properties like normal mode vibrational frequncies.

Mfloat

The total mass of the angle axis site

Wfloat

The sum of all the weights. For this is just the number of atoms.

cognp.array

center of geometry. If the atom masses are not all the same this can be different from the center of mass. Normally the center of mass is located 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. These are computed automatically.

atom_positionslist of arrays of length 3

the position of the atoms in the lab frame

atom_typeslist of strings

list of atom types

atom_masseslist of floats

Notes

This defines a collection of atoms that compose a single rigid bodies. This class collects all the information necessary to perform operations on the rigid body such as converting from center of mass + angle axis rotataion to atomistic coordinates. In the most simple case, this is just a whole molecule

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.

Usage

Add the atoms to the rigid fragment one at a time. When they are all added call self.finalize_setup(). The relevant properties of the rigid fragment, including center of geometry, tensor of gyration, and internal symmetries will be computed automatically.

The base class is pele.angleaxis.AASiteType.

RigidFragment.add_atom()[source]

Source

def add_atom(self, atomtype, pos, mass=1.0):

Add a new atom to the rigid fragment

Parameters:
atomtype: string

type identifier

pos: np.array

position of the atom sn402: I think this is in absolute Cartesian coords?

mass: mass of the atom
RigidFragment.finalize_setup()[source]

Source

def finalize_setup(self, shift_com=True):

finalize setup after all sites have been added

This will shift the center of mass to the origin and calculate the total mass and weighted tensor of gyration

RigidFragment.to_atomistic()[source]

Source

def to_atomistic(self, com, p):

convert the center of mass position + angle axis vector to atomistic coords

class pele.angleaxis.rigidbody.RigidFragmentBulk[source]

Source

class RigidFragmentBulk(RigidFragment):

Modified site type class; this is an exact copy of RigidFragment but with an overloaded method “get_smallest_rij” to incorporate periodic boundary conditions.

RigidFragmentBulk.get_smallest_rij()[source]

Source

def get_smallest_rij(self, com1, com2):

return the shortest vector from com1 to com2 (both numpy arrays containing coordinates for any number of atoms) using periodic boundary conditions.

class pele.angleaxis.rigidbody.RBTopology[source]

Source

class RBTopology(aatopology.AATopology):

This defines the topology of a collection of rigid bodies.

RBTopology.add_sites()[source]

Source

def add_sites(self, sites):

add sites to the Rigid Body topology

Parameters:
sitesRigidFragment

usually this will be an object of type RigidFragment

RBTopology.to_atomistic()[source]

Source

def to_atomistic(self, rbcoords):

convert rigid body coords to atomistic coords

Note: there is a c++ implementation of which is much faster

RBTopology.transform_gradient()[source]

Source

def transform_gradient(self, rbcoords, grad):

convert atomistic gradient into a gradient in rigid body coords

Note: there is a c++ implementation of which is much faster

RBTopology.set_cpp_topology()[source]

Source

def set_cpp_topology(self, cpp_topology):

provide class to access the fast c++ topology routines

class pele.angleaxis.rigidbody.RBPotentialWrapper[source]

Source

class RBPotentialWrapper(potential):

Wrap a potential

Note: there is a c++ implementation of which is much faster