Package schrodinger :: Package application :: Package matsci :: Package nano :: Module xtal :: Class PBCBonds
[hide private]
[frames] | no frames]

Class PBCBonds

object --+
         |
        PBCBonds

Class to manage a collection of PBC bonds.

Instance Methods [hide private]
 
__init__(self, cell_indices=None, pbc_bonds_dict=None, cell_size=None, no_pbc_bonding=False, only_pbc_bonds=False, cov_offset=0.45)
Create an instance.
 
setPBCBonds(self, pbc_bonds_dict)
Create a dictionary of PBCBond objects from a dictionary containing PBC bonds.
 
updatePBCBondOrders(self, astructure)
Update the bond orders in this instance given a structure with updated PBC bond orders.
str
__repr__(self)
Define a class representation.
 
setDeltasToNeighboringCells(self, astructure, lattice_vectors)
For each PBC bond in this cell determine the cell deltas that are needed to move ahead and behind to relevant neighboring cells.
 
cleanUpPBCBonds(self, astructure, pairs, delete)
Clean up the specified PBC bonds in the structure.
PBCBonds
getOffsetPBCBonds(self, cell_indices, offset)
Return a PBCBonds instance for the provided cell indices in which the atom indices have been offset by the given amount.
 
connectToCells(self, astructure, ncella, ncellb, ncellc, direction)
Connect the PBC bonds in this cell with those relevant neighboring cells ahead of or behind this one so as to create real bonds from pairs of PBC bonds or new PBC bonds.

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

Class Variables [hide private]
  FIRST_CELL = (1, 1, 1)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cell_indices=None, pbc_bonds_dict=None, cell_size=None, no_pbc_bonding=False, only_pbc_bonds=False, cov_offset=0.45)
(Constructor)

 

Create an instance.

Parameters:
  • cell_indices (tuple or None) - a triple of cell indices indicating to which cell the given PBC bonds belong, if None then the first cell will be used
  • pbc_bonds_dict (dict or None) - used to create a dictionary of PBCBond objects, keys are tuples of PBC bond atom index pairs, values are tuples of bond orders and booleans indicating whether the PBC bond is also a regular bond, if None then the dictionary of PBCBond ojects will be empty
  • cell_size (int) - the number of atoms in a cell
  • no_pbc_bonding (bool) - if True then no new PBC bonds will be created
  • only_pbc_bonds (bool) - if True then only PBC bonds will be created, i.e. regular bonds will not be created
  • cov_offset (float) - the maximum distance for a connection is the sum of the covalent radii of the two atoms weighted by cov_factor plus this offset in angstrom, increasing this value will increase the number of connections
Overrides: object.__init__

setPBCBonds(self, pbc_bonds_dict)

 

Create a dictionary of PBCBond objects from a dictionary containing PBC bonds.

Parameters:
  • pbc_bonds_dict (dict) - keys are tuples of PBC bond atom index pairs, values are tuples of bond orders and booleans indicating whether the PBC bond is also a regular bond

updatePBCBondOrders(self, astructure)

 

Update the bond orders in this instance given a structure with updated PBC bond orders.

Parameters:
  • astructure (schrodinger.Structure.structure) - the structure with the updated PBC bond orders

__repr__(self)
(Representation operator)

 

Define a class representation.

Returns: str
string representation of the class
Overrides: object.__repr__

setDeltasToNeighboringCells(self, astructure, lattice_vectors)

 

For each PBC bond in this cell determine the cell deltas that are needed to move ahead and behind to relevant neighboring cells.

Parameters:
  • astructure (schrodinger.Structure.structure) - the structure with the PBC bonds
  • lattice_vectors (list of numpy.array) - the lattice a, b, and c vectors

cleanUpPBCBonds(self, astructure, pairs, delete)

 

Clean up the specified PBC bonds in the structure.

Parameters:
  • astructure (schrodinger.Structure.structure) - the structure with the PBC bonds
  • pairs (list) - tuples of PBC bonding atom index pairs
  • delete (bool) - if True then the PBC bonds will be deleted

getOffsetPBCBonds(self, cell_indices, offset)

 

Return a PBCBonds instance for the provided cell indices in which the atom indices have been offset by the given amount.

Parameters:
  • cell_indices (tuple) - a triple of cell indices indicating to which cell the offset PBC bonds belong
  • offset (int) - the offset to use in setting the atom indices
Returns: PBCBonds
a PBCBonds object for the given cell containing the offset atoms

connectToCells(self, astructure, ncella, ncellb, ncellc, direction)

 

Connect the PBC bonds in this cell with those relevant neighboring cells ahead of or behind this one so as to create real bonds from pairs of PBC bonds or new PBC bonds. If this cell is the first or last along a given direction then if possible it will create new PBC bonds by wrapping around to ending or beginning cells, respectively.

Parameters:
  • astructure (schrodinger.Structure.structure) - the structure for which the connections are sought
  • ncella (int) - the number of cells along a
  • ncellb (int) - the number of cells along b
  • ncellc (int) - the number of cells along c
  • direction (str) - the direction in which to go for the next PBC bond, either PBCBond.AHEAD or PBCBond.BEHIND