You get an error if the reference is not set. Since we explicitly asking for UHF I think checking the reference keyword is not necessary. For RHF however, we need to check if the number of electrons is even!
I think the following should be done with the macro @energy
uhf maps to UHF no matter what
rhf maps to RHF but checks the number of electrons (done inside the RHF code already)
scf looks up the keyword reference and maps to uhf or rhf
If you try
You get an error if the reference is not set. Since we explicitly asking for UHF I think checking the reference keyword is not necessary. For
RHF
however, we need to check if the number of electrons is even!I think the following should be done with the macro
@energy
uhf
maps to UHF no matter whatrhf
maps to RHF but checks the number of electrons (done inside the RHF code already)scf
looks up the keywordreference
and maps touhf
orrhf