Ionic approximation of bonds (source code)

= Ionic approximation of bonds
{title2=$\mathrm{OS}_i=v_i-N_i^{\mathrm{assigned}}$}

For the routine examples here, assign all bonding <Electrons> between different <chemical elements> to the more <electronegative> partner; divide bonding <Electrons> between identical <chemical elements> equally. Retain each <lone pair> on its original <chemical atom>. Subtract the assigned <valence electron> count $N_i^{\mathrm{assigned}}$ from the neutral <chemical atom>'s <valence electron> count $v_i$. The IUPAC convention uses Allen <electronegativity>, based on free-<chemical atom> <valence electron> <energies>. Close <electronegativity> comparisons and some reversibly bound <chemical compounds> require care beyond this simple rule.<Comprehensive definition of oxidation state (IUPAC Recommendations 2016) by Pavel Karen and others>[§3 and §4.1, pp. 833–834: Allen electronegativity, electron allegiance and the reversible Lewis-acid-ligand caveat; §5.5, pp. 836–837: ambiguous assignments]{ref}

\Image[/oxidation-state-electron-bookkeeping.png]
{title=<Oxidation state> assignments for <water>, <hydrogen peroxide>, <molecular oxygen> and <sodium hydride>}
{id=image-oxidation-state-electron-bookkeeping}
{description=Original bookkeeping diagrams, not <electron density> maps or measured <partial atomic charges>. Arrows indicate allocation of bonding <Electrons>; an equal split is used for O–O. The <sodium hydride> panel represents a <formula unit> of an <ionic compound>, not an isolated gas-phase <molecule>.}

The examples explain exceptions to memorized rules:

* <Water>, $\mathrm{H{-}O{-}H}$: <oxygen> receives both O–H <bond pairs> plus its two <lone pairs>, giving eight assigned <valence electrons> and $6-8=-2$. Each <hydrogen> receives none, giving $1-0=+1$.
* <Hydrogen peroxide>, $\mathrm{H{-}O{-}O{-}H}$: each <oxygen> receives its O–H <bond pair>, one <Electron> from O–O, and four <Electrons> in <lone pairs>. Thus each has $6-7=-1$, while each <hydrogen> remains $+1$. The O–O connection is why the usual $-2$ <oxygen> shortcut fails.
* <Molecular oxygen>, $\mathrm{O}_2$: equal splitting of the O–O bonding <Electrons> leaves each <oxygen> assigned six <valence electrons>, so each has <oxidation state> zero.
* <Sodium hydride>, $\mathrm{NaH}$: <hydrogen> is more <electronegative> than <sodium>. The <formula unit> is assigned <sodium> $+1$ and <hydrogen> $-1$, consistent with the <hydrogen anion>. The usual $+1$ <hydrogen> shortcut fails here.

These drawings record allocations, not <molecular geometry> or a physical process of breaking the <chemical bonds>. In particular, the O–O line in the <molecular oxygen> panel only marks the connection; it does not assert a complete <Lewis structure> or <spin> state.