Task: Fix the edge case CAS(2,2) for Selected CI (issue #1808) (pyscf/pyscf#1845)

org: pyscf
repo: pyscf
pr_number: 1845
issue_title: Fix the edge case CAS(2,2) for Selected CI (issue #1808)
resolved_issues: number: 1808
title: Selected CI gives wrong results for a CAS of (2,2)
body: Dear developers,

I was trying to use selected CI as my CASCI solver by looking at the following example: https://github.com/pyscf/pyscf.github.io/blob/master/examples/mcscf/50-casscf_with_selected_ci.py

However, the selected CI results were wrong when I choose a CAS of (2,2):
```
from pyscf import gto, scf, mcscf, fci

b = 1.2
mol = gto.M(
    atom = 'N 0 0 0; N 0 0 %f'%b,
    basis = 'cc-pvdz',
)
mf = scf.RHF(mol).run()
mc = mcscf.CASCI(mf, 2, 2).run()

#
# Use SCI (Selected CI) to replace fcisolver
#
mc = mcscf.CASCI(mf, 2, 2)
mc.fcisolver = fci.SCI(mol)
mc.kernel() 
```

Here are the results. I am using pyscf version `2.1.1`
```
converged SCF energy = -108.914051975052

CASCI E = -108.94356411985  E(CI) = -1.71486588690826  S^2 = 0.0000000

CASCI E = -108.914051975052  E(CI) = -1.68535374211038  S^2 = 0.0000000
```
The selected CI seems to have only the doubly occupied determinant and misses the other doubly excited determinant. I know this is an edge case but thought of bringing this to your attention nevertheless. Thanks!


Reference solution:
fix_patch: diff --git a/pyscf/fci/selected_ci.py b/pyscf/fci/selected_ci.py
index c51b8a811a..14aae7861c 100644
--- a/pyscf/fci/selected_ci.py
+++ b/pyscf/fci/selected_ci.py
@@ -115,7 +115,7 @@ def select_strs(myci, eri, eri_pq_max, civec_max, strs, norb, nelec):
     strs = numpy.asarray(strs, dtype=numpy.int64)
     nstrs = len(strs)
     nvir = norb - nelec
-    strs_add = numpy.empty((nstrs*(nelec*nvir)**2//4), dtype=numpy.int64)
+    strs_add = numpy.empty((nstrs*((nelec+1)*(nvir+1))**2//4), dtype=numpy.int64)
     libfci.SCIselect_strs.restype = ctypes.c_int
     nadd = libfci.SCIselect_strs(strs_add.ctypes.data_as(ctypes.c_void_p),
                                  strs.ctypes.data_as(ctypes.c_void_p),