Atom class#

class AaronTools.atoms.Atom(element='', coords=None, flag=False, name='', tags=None, charge=None, mass=None)#

Attributes:

  • element str

  • coords np.array(float)

  • flag bool true if frozen, false if relaxed

  • name str form of d+(.d+)*

  • tags set

  • charge float

  • connected set(Atom)

  • constraint set(Atom) for determining constrained bonds

  • _rank

  • _radii float for calculating if bonded

  • _connectivity int max connections without hypervalence

  • _saturation int max connections without hypervalence or charges

__init__(element='', coords=None, flag=False, name='', tags=None, charge=None, mass=None)#
Parameters:
  • element (str) – element symbol

  • coords (np.ndarray) – position

  • flag (bool) – whether atom is frozen

  • name (str) – atom name

  • tags (list) – misc. data

  • charge (float) – partial charge of atom

  • mass (float) – mass of atom

get_invariant()#

gets initial invariant, which is formulated using:

  1. number of non-hydrogen connections (d{1}): nconn

  2. sum of bond order of non-hydrogen bonds * 10 (d{2}): nB

  3. atomic number (d{3}): z

  4. sign of charge (d{1}) (not used)

  5. absolute charge (d{1}) (not used)

  6. number of attached hydrogens (d{1}): nH

get_neighbor_id()#

gets initial invariant based on self’s element and the element of the atoms connected to self

is_connected(other, tolerance=None)#

determines if distance between atoms is small enough to be bonded

dist_is_connected(other, dist_to_other, tolerance)#

determines if distance between atoms is small enough to be bonded

used to optimize connected checks when distances can be quickly precalculated, like with scipy.spatial.distance_matrix

add_bond_to(other)#

add self and other to eachother’s connected attribute

bond(other)#

returns the vector self–>other

dist(other)#

returns the distance between self and other

angle(a1, a3)#

returns the a1-self-a3 angle

property mass#

returns atomic mass

classmethod get_shape(shape_name)#

returns dummy atoms in an idealized vsepr geometry

shape_name can be:

  • point

  • linear 1

  • linear 2

  • bent 2 tetrahedral

  • bent 2 planar

  • trigonal planar

  • bent 3 tetrahedral

  • t shaped

  • tetrahedral

  • sawhorse

  • seesaw

  • square planar

  • trigonal pyramidal

  • trigonal bipyramidal

  • square pyramidal

  • pentagonal

  • hexagonal

  • trigonal prismatic

  • pentagonal pyramidal

  • octahedral

  • capped octahedral

  • hexagonal pyramidal

  • pentagonal bipyramidal

  • capped trigonal prismatic

  • heptagonal

  • hexagonal bipyramidal

  • heptagonal pyramidal

  • octagonal

  • square antiprismatic

  • trigonal dodecahedral

  • capped cube

  • biaugmented trigonal prismatic

  • cubic

  • elongated trigonal bipyramidal

  • capped square antiprismatic

  • enneagonal

  • heptagonal bipyramidal

  • hula-hoop

  • triangular cupola

  • tridiminished icosahedral

  • muffin

  • octagonal pyramidal

  • tricapped trigonal prismatic

classmethod linear_shape()#

returns a list of 3 dummy atoms in a linear shape

classmethod trigonal_planar_shape()#

returns a list of 4 dummy atoms in a trigonal planar shape

classmethod tetrahedral_shape()#

returns a list of 5 dummy atoms in a tetrahedral shape

classmethod trigonal_bipyramidal_shape()#

returns a list of 6 dummy atoms in a trigonal bipyramidal shape

classmethod octahedral_shape()#

returns a list of 7 dummy atoms in an octahedral shape

static new_shape(old_shape, new_connectivity, bond_change)#

returns the name of the expected vsepr geometry when the number of bonds changes by +/- 1

Parameters:
  • old_shape (str) – vsepr geometry name

  • new_connectivity (int) – connectivity (see Atom._connectivity)

  • bond_change (int) – +1 or -1, indicating that the number of bonds is changing by 1

get_vsepr()#

determine vsepr geometry around an atom

Returns:

  • shape, score:

    as a string and the score assigned to that shape

  • None:

    if self has > 6 bonds

scores > 0.5 are generally questionable

see atom.get_shape for a list of shapes