Task: Fix addons.smearing RHF electron number (pyscf/pyscf#2290)

org: pyscf
repo: pyscf
pr_number: 2290
issue_title: Fix addons.smearing RHF electron number
issue_body: Fixes #2289.
resolved_issues: number: 2289
title: Smearing electron number bug
body: Smeared RHF with odd nelec gives incorrect electron number.

```
from pyscf import gto, scf
from pyscf.scf import addons

mol = gto.Mole()
mol.atom = '''
    7      0.   0  -0.7
    7      0.   0   0.7'''
mol.basis = 'cc-pvdz'
mol.charge = -1
mol.spin = 1
mol.build()
mf = scf.RHF(mol)
mf = addons.smearing(mf, sigma=0.1)
mf.kernel()
print(mf.mol.nelectron)
print(mf.mo_occ.sum())
```

```
converged SCF energy = -42.2391465363651
15
16.0
```

Reference solution:
fix_patch: diff --git a/pyscf/scf/addons.py b/pyscf/scf/addons.py
index a120087f33..4f26a5367b 100644
--- a/pyscf/scf/addons.py
+++ b/pyscf/scf/addons.py
@@ -83,7 +83,7 @@ def nelec_cost_fn(m, mo_es, nocc):
 
 def _get_fermi(mo_energy, nocc):
     mo_e_sorted = numpy.sort(mo_energy)
-    return mo_e_sorted[nocc-1]
+    return mo_e_sorted[numpy.ceil(nocc).astype(int) - 1]
 
 class _SmearingSCF:
 
@@ -174,7 +174,7 @@ def get_occ(self, mo_energy=None, mo_coeff=None):
             else:
                 mo_es = mo_energy
             if is_rhf:
-                nocc = (nelectron + 1) // 2
+                nocc = nelectron / 2
 
             if self.mu0 is None:
                 mu, mo_occs = _smearing_optimize(f_occ, mo_es, nocc, sigma)