Skip to content

Bounds Matrix

The bounds matrix encodes the geometric constraints between all atom pairs. It is the central data structure of distance geometry — all subsequent steps derive from it.

Matrix Layout

For N atoms, the bounds matrix B is an N×N matrix:

  • Upper triangle (i<j): upper bounds uij
  • Lower triangle (j<i): lower bounds lij (stored as B[j][i])
  • Diagonal: zero

1-2 Bounds (Bonded Pairs)

For directly bonded atoms, the distance is the bond length computed from UFF (Universal Force Field) parameters:

rij=ri+rj+rBOrEN

where:

Bond order correction:

rBO=0.1332(ri+rj)ln(BO)

Electronegativity correction:

rEN=rirj(χiχj)2χiri+χjrj

These terms come from the UFF parameterization. ri is the covalent radius, χi is the GMP electronegativity, and BO is the bond order.

The bounds are very tight: [rij0.01,rij+0.01] Å.

Special Case: Conjugated Heterocycles

For conjugated bonds in 5-membered rings involving heteroatoms (like pyrrole, furan), an additional squish factor of 0.2 Å is applied to the lower bound to accommodate aromatic bond length variation:

lij=rij0.010.2

UFF Parameters

Selected covalent radii and electronegativities:

Elementri (Å)χi
H0.3542.20
C (SP3)0.7572.55
C (SP2)0.7322.55
C (SP)0.7062.55
N (SP3)0.7003.04
O (SP3)0.6583.44
F0.6683.98
S1.0472.58
Cl1.0442.87
Br1.2142.74

1-3 Bounds (Angle Paths)

For atoms separated by two bonds (sharing a common neighbor), the distance is computed via the law of cosines:

d13=d12+d222d1d2cosθ

The equilibrium angle θ depends on hybridization:

HybridizationAngle θ
SP180°
SP2120°
SP3109.47°

The tolerance for 1-3 bounds is ±0.04 Å, doubled for each "large SP2 atom" in the path (atomic number > 13 that is SP2 and in a ring).

When multiple paths connect the same atom pair, union semantics apply: the lower bound is the minimum lower bound and the upper bound is the maximum upper bound across all paths.

1-4 Bounds (Torsion Paths)

For atoms separated by three bonds, the distance depends on the torsion angle between the two outer atoms. We compute the extreme distances at cis (ϕ=0°) and trans (ϕ=180°) configurations.

The cis and trans distances are computed from planar geometry:

dcis=(x3x0)2+(y3y0)2

where:

  • x0=r12cosα, y0=r12sinα
  • x3=r23r34cosβ, y3=r34sinβ

For the trans case, y3=r34sinβ.

Stereochemistry Constraints

Bond TypeLower BoundUpper Bound
E/Z stereoforced cis or transsame
SP2–SP2 (not in ring)dcisdtrans
SP2–SP2 (in same ring)dcisdcis (planar)
Amide / Esterdcisdtrans with bias
Defaultmin(dcis,dtrans)max(dcis,dtrans)

VDW Bounds (Non-bonded)

For atom pairs with topological distance ≥ 4, the lower bound comes from van der Waals radii:

lij=f(rvdwi+rvdwj)

The scaling factor f depends on topological distance:

Topological DistanceFactor f
40.70
50.85
≥61.00

The upper bound for non-bonded pairs defaults to 106 Å (effectively unconstrained) until tightened by triangle smoothing.

Triangle Inequality Smoothing

After populating bounds from all sources, Floyd-Warshall tightens them:

for k in 0..N:
    for i in 0..N:
        for j in (i+1)..N:
            u[i][j] = min(u[i][j], u[i][k] + u[k][j])
            l[i][j] = max(l[i][j], l[i][k] - u[k][j], l[k][j] - u[i][k])
            if l[i][j] > u[i][j]:
                INFEASIBLE

This is O(N3) and typically tightens many VDW upper bounds from 106 to reasonable values.

Fallback Strategy

If triangle smoothing detects infeasibility (lij>uij), sci-form tries a sequence of fallbacks:

  1. Strict bounds + set15 (1-5 bounds enabled) — most constrained
  2. No set15 — relax 1-5 constraints
  3. Soft smoothing — allow lij>uij with tolerance 0.05 Å

This ensures even strained molecules can produce initial coordinates, with the force field correcting violations later.

Released under the MIT License.