Skip to content

N₂ CASSCF — RHF code path

Molecular nitrogen with a CASSCF wavefunction (7384 determinants, 14 electrons) where all natural orbital occupations are exactly 2.0. Because the orbital occupations are integer (closed-shell), the wavefunction reader activates the RHF code path even though the .wfn file contains CASSCF determinant data.

Files

test/n2casb.edfinp      — input
test/n2casb.wfn         — CASSCF wavefunction (all NOs have occupation 2.0)
test/n2casb.wfn.aom     — AOM from PROMOLDEN
test/n2casb.edfout      — reference output

Input

0
n2casb.wfn.aom
n2casb.wfn
rhfmode
aomnorm  1
end

The rhfmode keyword is not recognized by the current keyword parser and a warning is written to stderr. It has no effect on the calculation — the RHF path is activated automatically by the wavefunction reader.

Why the RHF path activates

The wavefunction reader (rdwfn.f) checks the orbital occupation numbers from the .wfn file. If all occupations are exactly 2.0 (within a tolerance), it sets rhf = .true. regardless of whether the wavefunction was generated by a CASSCF calculation:

if (abs(occmax-2.0d+00).lt.tolocc .and.
&   abs(occmin-2.0d+00).lt.tolocc) then
    rhf = .true.

For N₂, the CASSCF natural orbitals all have occupations of exactly 2.0 due to the molecule's closed-shell symmetry, so the fast single-determinant code path is used even though 7384 determinants are in the file.

Fragment setup

No NGROUP keyword — each atomic basin is its own independent fragment. For N₂ (2 atoms), this gives 2 fragments.

Key output

Wavefunction info

# Number of electrons               =   14
# Number of determinants in WFN     = 7384

Despite 7384 determinants in the file, the RHF code path is used.

Average populations

<n(  1)_alpha>  =  3.500000054     <- N atom 1
<n(  2)_alpha>  =  3.499999946     <- N atom 2

Exactly 3.5 alpha electrons per atom (7 electrons per N, halved by spin). The deviations from 3.5 are numerical noise (~5×10⁻⁸) from the AOM integration and renormalization.

Probability distribution

#  SUM, 8 PROBABILITIES > 0.0
#  TOTAL SUM = 1.0000000000000800

Only 8 alpha probabilities — consistent with a single-determinant N₂ EDF where alpha electrons can be distributed (0 to 7) between the two nitrogen atoms: 8 = 7+1 configurations.

Running

cd test/
OMP_NUM_THREADS=1 ../edf-omp < n2casb.edfinp > n2casb_new.edfout

For this small system (single-determinant path, 2 atoms), threading provides no benefit. The calculation completes in milliseconds.