PyFrag
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
qmworks.plams.core.basemol.Bond Class Reference
Inheritance diagram for qmworks.plams.core.basemol.Bond:
Inheritance graph
[legend]
Collaboration diagram for qmworks.plams.core.basemol.Bond:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, atom1, atom2, order=1, mol=None, other)
 
def __str__ (self)
 
def __iter__ (self)
 
def is_aromatic (self)
 
def length (self, unit='angstrom')
 
def other_end (self, atom)
 
def resize (self, atom, length, unit='angstrom')
 

Public Attributes

 atom1
 
 atom2
 
 order
 
 mol
 
 properties
 

Static Public Attributes

float AR = 1.5
 

Detailed Description

A class representing a bond between two atoms.

An instance of this class has the following attributes:
    *   ``atom1`` and ``atom2`` -- two instances of |Atom| that form this bond
    *   ``order`` -- order of the bond. It is either an integer number or the floating point value stored in ``Bond.AR``, indicating aromatic bond
    *   ``mol`` -- a |Molecule| this bond belongs to
    *   ``properties`` -- a |Settings| instance storing all other  information about this bond (initially it is populated with *\*\*other* keyword arguments passed to the constructor)

.. note::

    Newly created bond is **not** added to ``atom1.bonds`` or ``atom2.bonds``. Storing information about |Bond| in |Atom| is relevant only in the context of the whole |Molecule|, so this information is updated by :meth:`~Molecule.add_bond`.

Member Function Documentation

◆ __iter__()

def qmworks.plams.core.basemol.Bond.__iter__ (   self)
Iterate over bonded atoms (``atom1`` first, then ``atom2``).

◆ __str__()

def qmworks.plams.core.basemol.Bond.__str__ (   self)
Return string representation of this bond.

◆ is_aromatic()

def qmworks.plams.core.basemol.Bond.is_aromatic (   self)
Check if this bond is aromatic.

◆ length()

def qmworks.plams.core.basemol.Bond.length (   self,
  unit = 'angstrom' 
)
Return bond's length, expressed in *unit*.
Here is the caller graph for this function:

◆ other_end()

def qmworks.plams.core.basemol.Bond.other_end (   self,
  atom 
)
Return the atom on the other end of this bond with respect to *atom*.

*atom* has to be either ``atom1`` or ``atom2``, otherwise an exception is raised.
Here is the caller graph for this function:

◆ resize()

def qmworks.plams.core.basemol.Bond.resize (   self,
  atom,
  length,
  unit = 'angstrom' 
)
Change the length of the bond to *length*.

This method works in the following way: one of two atoms forming this bond is moved along the bond in such a way that new length is *length*, in *unit* (direction of the bond in space does not change). Atom indicated by *atom* has to be one of bond's atoms and it is the atom that is **not** moved.
Here is the call graph for this function:

The documentation for this class was generated from the following file: