UFF4MOF parameters¶
UFF4MOF parameter table and the bond, angle, torsion, inversion and van der Waals combining rules: cage_isomer_builder.utils.uff4mof_params.
UFF4MOF parameter database and force-field combining-rule math.
Implements the bond, angle, torsion and van der Waals equations from
Rappe et al., J. Am. Chem. Soc. 1992, 114, 10024, using the UFF4MOF
parameter extensions from Addicoat et al., J. Chem. Theory Comput. 2014,
10, 880 and Coupry et al., J. Chem. Theory Comput. 2016, both bundled in
cage_isomer_builder/__data__/uff4mof_data.py.
UFFAtomParams
dataclass
¶
load_uff4mof_db ¶
Return the UFF4MOF type -> params dict from the vendored data table.
include_derived adds the types in DERIVED_UFF4MOF_DATA (assignable
by the atom typing but without a published parameter set; see that
table's comment).
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import load_uff4mof_db
>>> db = load_uff4mof_db()
>>> "C_R" in db, "Zr6f3" in db, "Zr6f3" in load_uff4mof_db(include_derived=False)
(True, True, False)
Source code in cage_isomer_builder/utils/uff4mof_params.py
hybridization_from_typename ¶
Return the UFF hybridization/geometry code for a type name, or None.
Per the UFF naming convention, the 3rd character encodes local geometry: 1=linear, 2/R=trigonal(planar/resonant), 3=tetrahedral, 4=square planar, 5=trigonal bipyramidal, 6=octahedral. Terminal types (H_, F_, Cl, ...) have no 3rd character and return None; they can never be an angle/torsion center since they have only one neighbour.
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import hybridization_from_typename
>>> hybridization_from_typename("C_R"), hybridization_from_typename("Zr6f3"), hybridization_from_typename("H_")
('R', '6', None)
Source code in cage_isomer_builder/utils/uff4mof_params.py
bond_params ¶
Bond-stretch equilibrium length and force constant (Rappe 1992 eqs 2-6).
Returns (R_IJ in Angstrom, K_IJ in kcal/mol/Angstrom**2).
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import load_uff4mof_db
>>> db = load_uff4mof_db()
>>> from cage_isomer_builder.utils.uff4mof_params import bond_params
>>> r, k = bond_params(db["C_3"], db["C_3"], 1.0)
>>> round(r, 3), round(k, 1) # C-C single bond: 1.514 A, kcal/mol/A^2
(1.514, 699.6)
Source code in cage_isomer_builder/utils/uff4mof_params.py
angle_coefficients ¶
angle_coefficients(p_i: UFFAtomParams, p_center: UFFAtomParams, p_k: UFFAtomParams, bo_ic: float, bo_ck: float) -> tuple[float, float, tuple[float, float, float, float, float]]
Angle-bend force constant and Fourier coefficients (Rappe 1992 eqs 12-15).
theta0 is the CENTER atom's equilibrium angle. Reuses bond_params for r_IJ/r_JK so the angle term stays consistent with the bond term.
Returns (theta0_rad, K in kcal/mol, (C0, C1, C2, C3, C4)) such that E = K * (C0 + C1cos(theta) + C2cos(2theta) + C3cos(3theta) + C4cos(4*theta)).
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import load_uff4mof_db
>>> db = load_uff4mof_db()
>>> import math
>>> from cage_isomer_builder.utils.uff4mof_params import angle_coefficients
>>> theta0, k, coeffs = angle_coefficients(db["H_"], db["C_3"], db["H_"], 1.0, 1.0)
>>> round(math.degrees(theta0), 2), len(coeffs)
(109.47, 5)
Source code in cage_isomer_builder/utils/uff4mof_params.py
torsion_params ¶
torsion_params(p_j: UFFAtomParams, p_k: UFFAtomParams, bond_order_jk: float, hyb_j: Optional[str], hyb_k: Optional[str], hyb_i: Optional[str] = None, hyb_l: Optional[str] = None) -> tuple[int, int, float]
Torsion periodicity, cosine-sign term and barrier for torsion i-j-k-l (Rappe 1992 eqs 16-17 and the rules below them).
Returns (n, cosTerm, V in kcal/mol) for E = 0.5V(1 - cosTermcos(nphi)). V is the barrier for the whole j-k bond; the calculator divides it by the number of torsions about that bond. cosTerm is always +1 or -1. Only sp2 and sp3 central atoms get a torsion; any other pair returns V = 0.
hyb_i and hyb_l are the hybridizations of the outer atoms. They
are only used for an sp2-sp3 bond where the sp2 atom's outer neighbour
is also sp2 (as in propene), which takes n = 3 and V = 2 kcal/mol.
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import load_uff4mof_db
>>> db = load_uff4mof_db()
>>> from cage_isomer_builder.utils.uff4mof_params import torsion_params
>>> n, cos_term, barrier = torsion_params(db["C_3"], db["C_3"], 1.0, "3", "3")
>>> n, cos_term, round(barrier, 3) # ethane: threefold, V = sqrt(V_C * V_C)
(3, -1, 2.119)
Source code in cage_isomer_builder/utils/uff4mof_params.py
inversion_params ¶
inversion_params(center_type: str, neighbour_types: tuple[str, str, str]) -> Optional[tuple[float, float, float, float]]
Out-of-plane (inversion) term for a centre with exactly three neighbours (Rappe 1992 eq 18).
Applies to sp2 carbon and nitrogen (C_2, C_R, N_2, N_R) and to P, As, Sb and Bi. Returns (K, C0, C1, C2) for E = K(C0 + C1cos(w) + C2*cos(2w)), where w is the angle between one bond and the plane of the other two. K is already divided by 3, because each centre gets three such terms. Returns None for any other centre.
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import inversion_params
>>> k, c0, c1, c2 = inversion_params("C_R", ("C_R", "C_R", "H_"))
>>> round(k, 3) # 6 kcal/mol shared over three terms
2.0
>>> print(inversion_params("C_3", ("H_", "H_", "H_"))) # sp3 carbon has none
None
Source code in cage_isomer_builder/utils/uff4mof_params.py
vdw_params ¶
van der Waals distance and well depth (Rappe 1992 eqs 20-22), geometric mean.
Examples:
>>> from cage_isomer_builder.utils.uff4mof_params import load_uff4mof_db
>>> db = load_uff4mof_db()
>>> from cage_isomer_builder.utils.uff4mof_params import vdw_params
>>> x, d = vdw_params(db["C_3"], db["C_3"])
>>> round(x, 3), round(d, 3) # geometric means of x and D
(3.851, 0.105)
Source code in cage_isomer_builder/utils/uff4mof_params.py
enumerate_bonds ¶
List of (i, j, bond_order) with i < j and bond_order > 0.
Examples:
>>> import numpy as np
>>> bonds = np.zeros((4, 4)) # a chain 0-1-2-3
>>> for i in range(3):
... bonds[i, i + 1] = bonds[i + 1, i] = 1.0
>>> from cage_isomer_builder.utils.uff4mof_params import enumerate_bonds
>>> enumerate_bonds(bonds)
[(0, 1, 1.0), (1, 2, 1.0), (2, 3, 1.0)]
Source code in cage_isomer_builder/utils/uff4mof_params.py
enumerate_angles ¶
List of (i, center, k): every unordered pair of neighbours of a center.
Examples:
>>> import numpy as np
>>> bonds = np.zeros((4, 4)) # a chain 0-1-2-3
>>> for i in range(3):
... bonds[i, i + 1] = bonds[i + 1, i] = 1.0
>>> from cage_isomer_builder.utils.uff4mof_params import enumerate_angles
>>> enumerate_angles(bonds) # (outer, centre, outer)
[(0, 1, 2), (1, 2, 3)]
Source code in cage_isomer_builder/utils/uff4mof_params.py
enumerate_torsions ¶
List of (i, j, k, l) dihedral quadruples, one central bond j-k at a time.
Examples:
>>> import numpy as np
>>> bonds = np.zeros((4, 4)) # a chain 0-1-2-3
>>> for i in range(3):
... bonds[i, i + 1] = bonds[i + 1, i] = 1.0
>>> from cage_isomer_builder.utils.uff4mof_params import enumerate_torsions
>>> enumerate_torsions(bonds)
[(0, 1, 2, 3)]
Source code in cage_isomer_builder/utils/uff4mof_params.py
enumerate_inversions ¶
List of (i, center, k, l) for every centre with exactly three
neighbours: three entries per centre, each with a different neighbour
as l, the atom whose angle to the i-center-k plane is measured.
Examples:
>>> import numpy as np
>>> from cage_isomer_builder.utils.uff4mof_params import enumerate_inversions
>>> bonds = np.zeros((4, 4))
>>> bonds[0, 1:] = bonds[1:, 0] = 1.0 # atom 0 with three neighbours
>>> len(enumerate_inversions(bonds)) # one term per neighbour taken as the "out" bond
3
Source code in cage_isomer_builder/utils/uff4mof_params.py
bond_graph_distance ¶
All-pairs shortest path length (in bonds); inf if disconnected.
Used to exclude 1-2 and 1-3 neighbours from the van der Waals term
(Rappe 1992 sec. on nonbonded interactions).
Examples:
>>> import numpy as np
>>> bonds = np.zeros((4, 4)) # a chain 0-1-2-3
>>> for i in range(3):
... bonds[i, i + 1] = bonds[i + 1, i] = 1.0
>>> from cage_isomer_builder.utils.uff4mof_params import bond_graph_distance
>>> bond_graph_distance(bonds)[0].tolist() # bonds between atom 0 and each atom
[0.0, 1.0, 2.0, 3.0]