Orbital class#

class AaronTools.orbitals.Orbitals(filereader)#

stores functions for the shells in a basis set for evaluation at arbitrary points

attributes:

  • basis_functions - list(len=n_shell) of lists(len=n_prim_per_shell) of functions

    function takes the arguments:

    • r2 - float array like, squared distance from the shell’s center to each point being evaluated

    • x, y, and z - float or array like, distance from the shell’s center to the point(s) being evaluated along the x axis

    • mo_coeffs - list(len=funcs_per_shell), MO coefficients for the functions in this shell (e.g. 3 coefficients for the p shell); order might depend on input file format for example, FCHK files will be px, py, pz ORCA files will be pz, px, py

  • funcs_per_shell - list(len=n_shell), number of basis functions for each shell

  • alpha_coefficients - array(shape=(n_mos, n_mos)), coefficients of molecular orbitals for alpha electrons

  • beta_coefficients - same as alpha_coefficients for beta electrons

  • shell_coords - array(shape=(n_shells, 3)), coordinates of each shell in Angstroms

  • shell_types - list(str, len=n_shell), type of each shell (e.g. s, p, sp, 5d, 6d…)

  • n_shell - number of shells

  • n_prim_per_shell - list(len=n_shell), number of primitives per shell

  • n_mos - number of molecular orbitals

  • exponents - array, exponents for primitives in Eh each shell

  • alpha_nrgs - array(len=n_mos), energy of alpha MO’s

  • beta_nrgs - array(len=n_mos), energy of beta MO’s

  • contraction_coeff - array, contraction coefficients for each primitive in each shell

  • n_alpha - int, number of alpha electrons

  • n_beta - int, number of beta electrons

__init__(filereader)#
mo_value(mo, coords, alpha=True, n_jobs=1)#

get the MO evaluated at the specified coords

Parameters:
  • mo (int|np.ndarray) – index of molecular orbital or an array of MO coefficients

  • coords (np.ndarray) – array of points (N,3) or (3,)

  • alpha (bool) – use alpha coefficients (default)

  • n_jobs (int) – number of parallel threads to use this is on top of NumPy’s multithreading, so if NumPy uses 8 threads and n_jobs=2, you can expect to see 16 threads in use

density_value(coords, n_jobs=1, alpha_occ=None, beta_occ=None, low_mem=False, spin=False)#

returns the eletron density

Parameters:
  • coords (np.ndarray) – coordinates to calculate e density at

  • n_jobs (int) – number of concurrent threads to use in calculation

  • alpha_occ (np.ndarray|None) –

    array of alpha occupancies

    if not specified, defaults to lowest self.n_alpha orbitals

  • beta_occ (np.ndarray|None) – same at alpha_occ, but for beta electrons

  • spin (bool) – plot spin density

fukui_donor_value(coords, delta=0.1, **kwargs)#

orbital-weighted fukui donor function

electron density change for removing an electron

orbital weighting from DOI 10.1002/jcc.24699 accounts for nearly degenerate orbitals

Parameters:
  • coords (np.ndarray) – coordinates to evaluate function at

  • delta (float) – parameter for weighting

  • kwargs – passed to density_value

fukui_acceptor_value(coords, delta=0.1, **kwargs)#

orbital-weighted fukui acceptor function

electron density change for removing an electron

orbital weighting from DOI 10.1021/acs.jpca.9b07516 accounts for nearly degenerate orbitals

Parameters:
  • coords (np.ndarray) – coordinates to evaluate function at

  • delta (float) – parameter for weighting

  • kwargs – passed to density_value

static get_cube_array(geom, padding=4, spacing=0.2, standard_axes=False)#
Returns:

n_pts1, n_pts2, n_pts3, v1, v2, v3, com, u

  • n_pts1 is the number of points along the first axis

  • n_pts2 … second axis

  • n_pts3 … third axis

  • v1 is the vector for the first axis, norm should be close to spacing

  • v2 … second axis

  • v3 … third axis

  • com is the center of the cube

  • u is a rotation matrix for the v1, v2, v3 axes relative to xyz

Parameters:
  • geom (Geometry) – used to define the cube

  • padding (float) – extra space around atoms in angstrom

  • spacing (float) – distance between adjacent points in angstrom

  • standard_axes (bool) – True to use x, y, and z axes by default, the cube will be oriented to fit the geom and have the smallest volume possible

static get_cube_points(n_pts1, n_pts2, n_pts3, v1, v2, v3, com, sort=True)#
Returns:

coords, n_list

  • coords is an array of points in the cube

  • n_list specifies where each point is along the axes

e.g. 5th point along v1, 4th point along v2, 0th point along v3

memory_estimate(func_name, n_points=None, low_mem=False, n_jobs=1, apoints=None, rpoints=None, n_atoms=None)#
Returns:

estimated memory use (in GB) for calling the

specified function on the specified number of points

if func_name is a condensed fukui function, apoints and rpoints must be given

otherwise, n_points must be given

voronoi_integral(target, geom, *args, rpoints=32, apoints=1454, func=None, rmax=None, **kwargs)#

integrates func in the Voronoi cell of the specified target

Parameters:
  • geom (Geometry) – structure target belongs to

  • args – passed to func

  • rpoints (int) – radial points used for Gauss-Legendre integral

  • apoints (int) – angular points for Lebedev integral

  • func (function) – function to evaluate

  • kwargs – passed to func

power_integral(target, geom, *args, radii='umn', rpoints=32, apoints=1454, func=None, rmax=None, **kwargs)#

integrates func in the power cell of the specified target

power diagrams are a form of weighted Voronoi diagrams that form cells based on the smallest d^2 - r^2

see wikipedia article: https://en.wikipedia.org/wiki/Power_diagram

Parameters:
  • radii (str|dict|list) – radii to use * “bondi” - Bondi vdW radii * “umn” - vdW radii from Mantina, Chamberlin, Valero, Cramer, and Truhlar * dict() - radii are values and elements are keys * list() - list of radii corresponding to targets

  • geom (Geometry) – target belongs to

  • args – passed to func

  • rpoints (int) – radial points used for Gauss-Legendre integral

  • apoints (int) – angular points for Lebedev integral

  • func (function) – function to evaluate

  • kwargs – passed to func

condensed_fukui_donor_values(geom, *args, **kwargs)#

uses power_integral to integrate the fukui_donor_value for all atoms in geom

values are normalized so they sum to 1

Parameters:

geom (Geometry) – structure

:param args:passed to power_integral :param kwargs: passed to power_integral

Returns:

array for each atom’s condensed Fukui donor values

condensed_fukui_acceptor_values(geom, *args, **kwargs)#

uses power_integral to integrate the fukui_acceptor_value for all atoms in geom

values are normalized so they sum to 1

Parameters:

geom (Geometry) – structure

:param args:passed to power_integral :param kwargs: passed to power_integral

Returns:

array for each atom’s condensed Fukui acceptor values

condensed_fukui_dual_values(geom, *args, **kwargs)#

returns the difference between condensed_fukui_acceptor_values and condensed_fukui_donor_values