Li2 FOO PDFT InversionΒΆ

[1]:
import numpy as np
import matplotlib.pyplot as plt
from CADMium import Pssolver, Psgrid, Partition, Inverter
import CADMium

a = 2/2
Za, Zb = 1,1
pol = 2

#Set up grid
NP = 7
NM = [4,4]
L = np.arccosh(10/a)
loc = np.array(range(-4,5)) #Stencil outline
grid = Psgrid(NP, NM, a, L, loc)
grid.initialize()


# ALPHA FRAGMENT
Nmo_a = [[1  ,0]];
N_a   = [[0.5,0]];
nu_a = 1.0

#Fragment b electrons
Nmo_b = [[1  ,0]];
N_b   = [[0.5,0]];
nu_b = 1.0

#Molecular elctron configuration
Nmo_m = [[1,0]]
N_m   = [[1,0]]


part = Partition(grid, Za, Zb, pol, Nmo_a, N_a, nu_a, Nmo_b, N_b, nu_b, {  "AB_SYM"            : True,
                                                                           "fractional"        : True,
#                                                                          "ENS_SPIN_SYM"      : False,
                                                                           "interaction_type"  : "dft",
                                                                           "kinetic_part_type" : "libxcke",
                                                                           "hxc_part_type"     : "exact",
                                                                           "k_family"          : "gga",
                                                                           "ke_func_id"        : 500,
                                                                            })

#Setup inverter object
mol_solver = Pssolver(grid, Nmo_m, N_m)
part.inverter = Inverter(grid, mol_solver, {  "AB_SYM"         : True,
#                                               "ENS_SPIN_SYM"   : False,
                                              "use_iterative"  : False,
                                              "invert_type"    : "wuyang",
                                              "DISP"           : False,
                                            })

part.optPartition.isolated = True
part.scf({"disp"  : True,
          "alpha" : [0.6],
          "e_tol" : 1e-8})

part.optPartition.isolated   = False
part.scf({"disp"       : True,
          "alpha"      : [0.6],
          "max_iter"   : 200,
          "e_tol"      : 2e-8,
          "iterative"  : False,
          "continuing" : True})
----> Begin SCF calculation for *Isolated* Fragments

                Total Energy (a.u.)

                __________________

Iteration         A            B              res

_______________________________________________________

    1           -0.27584     -0.27584       1.000e+00
    2           -0.28369     -0.28369       2.330e-01
    3           -0.28699     -0.28699       8.915e-02
    4           -0.28837     -0.28837       3.597e-02
    5           -0.28895     -0.28895       1.482e-02
    6           -0.28919     -0.28919       6.158e-03
    7           -0.28929     -0.28929       2.568e-03
    8           -0.28933     -0.28933       1.073e-03
    9           -0.28935     -0.28935       4.485e-04
   10           -0.28935     -0.28935       1.876e-04
   11           -0.28936     -0.28936       7.847e-05
   12           -0.28936     -0.28936       3.283e-05
   13           -0.28936     -0.28936       1.374e-05
   14           -0.28936     -0.28936       5.752e-06
   15           -0.28936     -0.28936       2.408e-06
   16           -0.28936     -0.28936       1.008e-06
   17           -0.28936     -0.28936       4.223e-07
   18           -0.28936     -0.28936       1.769e-07
   19           -0.28936     -0.28936       7.410e-08
   20           -0.28936     -0.28936       3.105e-08
   21           -0.28936     -0.28936       1.301e-08
   22           -0.28936     -0.28936       5.454e-09
----> Begin SCF calculation for *Interacting* Fragments

                Total Energy (a.u.)

                __________________

Iteration         A            B              res

_______________________________________________________

    1           -0.25277     -0.25277       1.000e+00
    2           -0.26283     -0.26283       1.013e-01
    3           -0.26799     -0.26799       4.251e-02
    4           -0.27025     -0.27025       1.715e-02
    5           -0.27121     -0.27121       6.872e-03
    6           -0.27160     -0.27160       2.746e-03
    7           -0.27177     -0.27177       1.096e-03
    8           -0.27184     -0.27184       4.368e-04
    9           -0.27186     -0.27186       1.740e-04
   10           -0.27187     -0.27187       6.934e-05
   11           -0.27188     -0.27188       2.765e-05
   12           -0.27188     -0.27188       1.103e-05
   13           -0.27188     -0.27188       4.411e-06
   14           -0.27188     -0.27188       1.766e-06
   15           -0.27188     -0.27188       7.088e-07
   16           -0.27188     -0.27188       2.851e-07
   17           -0.27188     -0.27188       1.150e-07
   18           -0.27188     -0.27188       4.650e-08
   19           -0.27188     -0.27188       1.886e-08