Shunyaya Symbolic Mathematical Chemistry – Reaction Stability Index — Definition (2.7)

What this page gives you: a single, bounded index that turns reactant/product alignments into a direction-and-preference signal. It preserves classical balances (collapse-safe), stays in (−1, +1), and is robust to rescaling of stoichiometry. You’ll use it to compare products, pathways, and scenarios on a common, auditable scale.

Idea in plain language

  • What RSI is: a dimensionless preference signal. Positive means products are symbolically more stable; negative favors reactants unless conditions lift an edge branch.
  • How it’s built: alignments from the contrast map (earlier page) are pooled separately for reactants and products in rapidity space. Their difference, normalized by reactant weight, is mapped back to (−1, +1).
  • Why it’s bounded: the outer tanh guarantees |RSI| < 1, making comparisons consistent and outlier-safe.
  • What never changes: under fixed stoichiometry and the symmetric contrast map, RSI’s sign matches the contrast sign; multiplying all coefficients by the same positive factor leaves RSI unchanged.
  • How to read it: thresholds are a program choice—RSI > 0 favors products; the magnitude ranks alternatives. If you model conditions, scale with the calm gate later: RSI_env = g_t * RSI.

Practical guidance

  • Weights (gamma): choose gamma to reflect emphasis (default 1). gamma = 0 gives equal weighting; larger gamma stresses larger magnitudes. Publish your choice.
  • Guards: always use the denominator guard for reactant weight and the same clamp policy used for alignments.
  • Streaming-friendly: you can add contributions species-by-species or step-by-step—useful for pathway ranking and incremental datasets.
  • Manifest note: publish gamma, eps_a, eps_w and a one-line guarantees blurb (bounded, sign follows contrast, monotone in e, invariant to common scaling of coefficients).

Plain ASCII formulas (copy-ready)

Weights and pooling (reactants vs products)

w = abs(m)^gamma              # gamma >= 0 (default 1)

U_r = sum_over_reactants( w_r * atanh_safe(a_r, eps_a) )
V_p = sum_over_products(  w_p * atanh_safe(a_p, eps_a) )

W_r = sum_over_reactants( w_r )
W_r_safe = max( W_r, eps_w )

Bounded preference

RSI = tanh( ( V_p - U_r ) / W_r_safe )

Inputs and guards (declare once per study)

# a_r and a_p come from the contrast map and are already clamped: |a| <= 1 - eps_a
# eps_w > 0 guards the denominator (e.g., 1e-12)
# gamma controls stoichiometric emphasis (publish gamma, eps_a, eps_w)

Properties (used downstream)

|RSI| < 1                        # bounded
V_p == U_r -> RSI = 0            # zero case
sign(RSI) = sign(e)              # sign lemma under fixed stoichiometry and symmetric map
RSI increases as e increases     # monotonicity (fixed stoichiometry)
RSI invariant to scaling of all stoichiometric coefficients by k > 0
Streaming: U_r, V_p, W_r are additive over species and steps

Minimal pseudocode

input:
  reactants = { (m_i, a_i) }
  products  = { (m_j, a_j) }
  gamma >= 0, eps_a > 0, eps_w > 0

# optional safety re-clamp
for each a in (all reactant a_i and product a_j):
  if abs(a) >= 1 - eps_a:
    a = (1 if a >= 0 else -1) * (1 - eps_a)

U_r = 0
for each reactant i:
  w = (abs(m_i)) ^ gamma
  U_r = U_r + w * atanh_safe(a_i, eps_a)

V_p = 0
for each product j:
  w = (abs(m_j)) ^ gamma
  V_p = V_p + w * atanh_safe(a_j, eps_a)

W_r = 0
for each reactant i:
  W_r = W_r + (abs(m_i)) ^ gamma

W_r_safe = max(W_r, eps_w)

s   = (V_p - U_r) / W_r_safe
RSI = tanh(s)

Publish note (manifest)

Record gamma, eps_a, eps_w and the clamp/guard policy reference.
Guarantees: |RSI| < 1 ; sign(RSI) = sign(e) ; RSI monotone in e (fixed stoichiometry) ;
duplication of a balanced reaction (common scalar) leaves RSI unchanged.


Navigation
Previous – Reaction Statement & Contrast Map (2.5, 2.6)
Next – Conditions & Priors — Calm Gate and Rapidity Nudges (2.8, 2.9)