Package schrodinger :: Package application :: Package matsci :: Module coarsegrain :: Class Internals
[hide private]
[frames] | no frames]

Class Internals

object --+
         |
        Internals

Manage the internal coordinates of a structure.

Instance Methods [hide private]
 
__init__(self, astructure, uniqueify=False)
Create an instance.
list
orderInternalByName(self, atoms)
Order the atoms of the given internal coordinate by name.
tuple
getNames(self, atoms, uniqueify=False)
Return the atom names for the given list of atoms.
tuple
getIdxs(self, atoms)
Return the atom indices for the given list of atoms.
dict
avgInternals(self, internals)
Average the values of the internals in the given dictionary of internals.
OrderedDict
recursivelySort(self, internals)
Return the given dictionary of internal coordinates recursively sorted by the names of the constitutive atoms.
bool
setInternals(self, internals, atoms, internals_excluded=None, data=None, uniqueify=False)
Set internals.
dict
averageAndSort(self, internals)
Average and sort the given internals.
 
setSites(self)
Set the sites dictionary.
 
setBonds(self)
Set the bonds dictionary.
 
setAngles(self)
Set angles dictionary.
 
setDihedrals(self)
Set dihedrals dictionary.
list
getNewAngles(self, new_bonds)
Return the new angles.
list
getNewDihedrals(self, new_bonds)
Return the new dihedrals.
 
updateInternals(self, new_bonds_tuples)
Update the internals.
dict
_findNonBondPairs(self, exclude=None)
This finds all pairs of particle types that have at least one non-bond interaction.
 
setNonBonds(self)
Set nonbonds dictionary.
 
setBasic(self)
Set basic dictionaries.
 
setAngleNonBonds(self)
Set angle nonbonds dictionary.
 
setNonAngleNonBonds(self)
Set the nonangle nonbonds dictionary.
 
addExcludedNonbonds(self, exclude_nonbonds)
Add exclude nonbonds.
dict
mergeExcludedNonbonds(self, exclude_nonbonds, new_exclude_nonbonds)
Return a copy of the first exclude nonbonds dict merged with the second.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, astructure, uniqueify=False)
(Constructor)

 

Create an instance.

Parameters:
  • astructure (structure.Structure) - the structure for which the internal coordinates are needed
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Overrides: object.__init__

orderInternalByName(self, atoms)

 

Order the atoms of the given internal coordinate by name.

Parameters:
  • atoms (list) - contains structure._StructureAtom of the internal coordinate to be ordered
Returns: list
atoms sorted by name

getNames(self, atoms, uniqueify=False)

 

Return the atom names for the given list of atoms.

Parameters:
  • atoms (list) - contains structure._StructureAtom
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Returns: tuple
contains atom names

getIdxs(self, atoms)

 

Return the atom indices for the given list of atoms.

Parameters:
  • atoms (list) - contains structure._StructureAtom
Returns: tuple
contains atom indices

avgInternals(self, internals)

 

Average the values of the internals in the given dictionary of internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
Returns: dict
keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values

recursivelySort(self, internals)

 

Return the given dictionary of internal coordinates recursively sorted by the names of the constitutive atoms.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values
Returns: OrderedDict
internals recursively sorted

setInternals(self, internals, atoms, internals_excluded=None, data=None, uniqueify=False)

 

Set internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
  • atoms (list) - contains structure._StructureAtom for a given internal
  • internals_excluded (dict or None) - contains internals that should be excluded from being set. keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
  • data (tuple or None) - a tuple of data for the given internal or None if it needs to be measured
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Returns: bool
True if the internal was set, or False if it was not set due to already appearing in the internals_excluded dict

averageAndSort(self, internals)

 

Average and sort the given internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
Returns: dict
sorted keys where keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values

getNewAngles(self, new_bonds)

 

Return the new angles.

Parameters:
  • new_bonds (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds
Returns: list
contains schrodinger.structure._StructureAtom triples tuples for new angles

getNewDihedrals(self, new_bonds)

 

Return the new dihedrals.

Parameters:
  • new_bonds (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds
Returns: list
contains schrodinger.structure._StructureAtom quadruples tuples for new dihedrals

updateInternals(self, new_bonds_tuples)

 

Update the internals.

Parameters:
  • new_bonds_tuples (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds

_findNonBondPairs(self, exclude=None)

 

This finds all pairs of particle types that have at least one non-bond interaction. Unlike other types of internals (sites, bonds, angles, etc) we do not want to enumerate all instances. Therefore, for each pair of types, we just check pairs of those atoms until we find a single non-bonded example. Once we have that one example, that's all we need to add that pair to the non-bond pair type list.

Parameters:
  • exclude (dict or None) - contains internals that should not be considered as example pairs, probably due to the 1-3 angle nonbond setting. keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
Returns: dict
keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values

addExcludedNonbonds(self, exclude_nonbonds)

 

Add exclude nonbonds.

Parameters:
  • exclude_nonbonds (dict) - contains pairs that should not be considered nonbonding, keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one

mergeExcludedNonbonds(self, exclude_nonbonds, new_exclude_nonbonds)

 

Return a copy of the first exclude nonbonds dict merged with the second.

Parameters:
  • exclude_nonbonds (dict) - contains pairs that should not be considered nonbonding, keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
  • new_exclude_nonbonds (dict) - contains pairs that should not be considered nonbonding, keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
Returns: dict
merged exclude nonbonds