O_2 LDAΒΆ

[7]:
import numpy as np
from CADMium import Psgrid
from CADMium import Kohnsham

#Distance of the nucley from grid center
a =  2.27296258 / 2

#Nuclear charges on centers AB
Za  = 8
Zb = 8

#Set polaization. 1 Unpolarized, 2 Polarized
pol = 1

Nmo = [[5], [3]]
N   = [[10],[6]]

optKS = {
        "interaction_type" : "dft",
        "SYM" : False,
        "FRACTIONAL" : False,
        }

#Grid Options
NP = 7 #Number of points per block
NM =  [16,16] #Number of blocks [angular, radial]
L = np.arccosh(10./a) #Maximum radial coordinate value
loc = np.array(range(-4,5)) #Non inclusive on upper bound

#Create and initialize grid object
grid = Psgrid(NP, NM, a, L, loc)
grid.initialize()

#Kohn Sham object
KS = Kohnsham(grid, Za, Zb, pol, Nmo, N, optKS)
KS.scf({
        "alpha" : 0.1
      })

print(f" Total Energy: {KS.E.E}")
 iter    Total Energy     HOMO Eigenvalue         Res

-----------------------------------------------------------

    1      -209.13991      -3.72546e-01       +1.00000e+00
    2      -201.12253      -5.20905e-01       +3.98632e-02
    3      -193.50441      -6.26693e-01       +3.93692e-02
    4      -186.97029      -7.17534e-01       +3.49474e-02
    5      -181.38677      -7.95452e-01       +3.07824e-02
    6      -176.61573      -8.61736e-01       +2.70137e-02
    7      -172.53687      -9.17709e-01       +2.36405e-02
    8      -169.04783      -9.64692e-01       +2.06394e-02
    9      -166.06178      -1.00393e+00       +1.79815e-02
   10      -163.50502      -1.03657e+00       +1.56372e-02
   11      -161.31489      -1.06360e+00       +1.35767e-02
   12      -159.43805      -1.08590e+00       +1.17716e-02
   13      -157.82905      -1.10424e+00       +1.01946e-02
   14      -156.44913      -1.11926e+00       +8.82029e-03
   15      -155.26289      -1.11971e+00       +7.64015e-03
   16      -154.21904      -1.14202e+00       +6.76865e-03
   17      -153.35367      -1.14994e+00       +5.64299e-03
   18      -152.60769      -1.15633e+00       +4.88821e-03
   19      -151.96646      -1.16143e+00       +4.21954e-03
   20      -151.40975      -1.16547e+00       +2.03707e-02
   21      -150.78964      -1.16454e+00       +4.11242e-03
   22      -150.43080      -1.16476e+00       +2.50885e-03
   23      -150.18831      -1.17285e+00       +2.08325e-03
   24      -149.88314      -1.17421e+00       +2.03602e-03
   25      -149.62090      -1.17530e+00       +1.75270e-03
   26      -149.39481      -1.17607e+00       +1.51338e-03
   27      -149.19977      -1.17661e+00       +1.30723e-03
   28      -149.03143      -1.17694e+00       +1.14984e-03
   29      -148.88606      -1.17713e+00       +1.01961e-03
   30      -148.76047      -1.17720e+00       +9.04154e-04
   31      -148.65190      -1.17718e+00       +8.01792e-04
   32      -148.55800      -1.17709e+00       +7.11035e-04
   33      -148.47676      -1.17695e+00       +6.30566e-04
   34      -148.40642      -1.17678e+00       +5.59219e-04
   35      -148.34550      -1.17658e+00       +4.95956e-04
   36      -148.29271      -1.17637e+00       +4.39861e-04
   37      -148.24694      -1.17615e+00       +3.90117e-04
   38      -148.20724      -1.17593e+00       +3.46004e-04
   39      -148.17279      -1.17571e+00       +3.06882e-04
   40      -148.14288      -1.17550e+00       +2.72188e-04
   41      -148.11690      -1.17529e+00       +2.41420e-04
   42      -148.09432      -1.17509e+00       +2.14132e-04
   43      -148.07469      -1.17490e+00       +1.89930e-04
   44      -148.05762      -1.17473e+00       +1.68464e-04
   45      -148.04277      -1.17456e+00       +1.49424e-04
   46      -148.02984      -1.17441e+00       +1.32534e-04
   47      -148.01858      -1.17426e+00       +1.17552e-04
   48      -148.00878      -1.17413e+00       +1.04261e-04
   49      -148.00023      -1.17400e+00       +9.24698e-05
   50      -147.99278      -1.17389e+00       +8.20077e-05
   51      -147.98628      -1.17378e+00       +7.27236e-05
   52      -147.98062      -1.17369e+00       +6.44838e-05
   53      -147.97567      -1.17360e+00       +5.71691e-05
   54      -147.97135      -1.17352e+00       +5.06739e-05
   55      -147.96759      -1.17345e+00       +4.49041e-05
   56      -147.96429      -1.17338e+00       +3.97762e-05
   57      -147.96142      -1.17332e+00       +3.52154e-05
   58      -147.95891      -1.17327e+00       +3.11555e-05
   59      -147.95671      -1.17322e+00       +2.75372e-05
   60      -147.95479      -1.17317e+00       +2.43085e-05
   61      -147.95311      -1.17313e+00       +2.14232e-05
   62      -147.95165      -1.17309e+00       +1.88417e-05
   63      -147.95036      -1.17306e+00       +1.65305e-05
   64      -147.94924      -1.17303e+00       +1.44625e-05
   65      -147.94826      -1.17300e+00       +1.26173e-05
   66      -147.94740      -1.17298e+00       +1.09793e-05
   67      -147.94665      -1.17295e+00       +9.53651e-06
 Total Energy: -147.94664735258655

Compare againts CCCBDB Energy: Etot = -149.650890