Electron fraction in stellar matter (source code)

= Electron fraction in stellar matter
{title2=$Y_e=\sum_i X_i Z_i/A_i$}

For electrically neutral, fully ionized stellar matter with <electrons> and <Positrons> as its charged <leptons>, the <electron fraction in stellar matter> is the net <electron> number per <baryon>:
$$
Y_e=\frac{n_{e^-}-n_{e^+}}{n_b}=\frac{\sum_iZ_i n_i}{\sum_iA_i n_i}.
$$
Here $n_i$ is the <number density> of nuclear species $i$, $Z_i$ its <atomic number>, $A_i$ its <mass number>, and $n_b$ the total baryon <number density>. <Charge neutrality> equates the net negative lepton charge to the total proton charge. The subtraction of <Positrons> matters in hot matter containing abundant thermally produced <Positrons>; ordinary electron number alone need not equal nuclear charge.<Electron fraction constraints based on nuclear statistical equilibrium with beta equilibrium by A. Arcones and others>[Section 2, net electron density definition before equation 6 and charge/baryon constraints in equations 7–8]{ref}

Neglecting small nuclear <mass defect> corrections, isotope <mass fractions> $X_i$ give $Y_e=\sum_iX_iZ_i/A_i$. Pure fully ionized <helium-4> therefore has $Y_e=1/2$. <Strong interactions> and electromagnetic reactions preserve this proton fraction, whereas <electron capture> and <beta-plus decay> reduce it and <beta-minus decay> can increase it. The total proton-to-neutron number ratio is $Y_e/(1-Y_e)$; electron-positron <pair production> changes neither of those baryon counts. If other charged <leptons> such as <muons> are appreciably populated, their charge must also be included in the neutrality equation.