{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Carbon LDA" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " iter Total Energy HOMO Eigenvalue Res \n", "\n", "----------------------------------------------------------- \n", "\n", " 1 -47.07842 +4.06268e-02 +1.00000e+00\n", " 2 -39.35222 -4.15177e-01 +1.96334e-01\n", " 3 -38.20657 -3.07153e-01 +2.99858e-02\n", " 4 -37.73128 -2.47922e-01 +1.25966e-02\n", " 5 -37.53763 -2.19361e-01 +5.15898e-03\n", " 6 -37.48970 -2.05967e-01 +1.47783e-03\n", " 7 -37.43071 -1.99693e-01 +1.57617e-03\n", " 8 -37.42208 -1.96697e-01 +4.89459e-04\n", " 9 -37.41911 -1.95332e-01 +2.65462e-04\n", " 10 -37.41841 -1.94686e-01 +1.41107e-04\n", " 11 -37.41839 -1.94378e-01 +7.37073e-05\n", " 12 -37.41852 -1.94230e-01 +3.80013e-05\n", " 13 -37.41865 -1.94159e-01 +1.93993e-05\n", " 14 -37.41873 -1.94125e-01 +9.82422e-06\n", " Total Energy: -37.4187337652327\n" ] } ], "source": [ "import numpy as np\n", "from CADMium import Psgrid\n", "from CADMium import Kohnsham\n", "\n", "#Distance of the nucley from grid center\n", "a = 1.0\n", "\n", "#Nuclear charges on centers AB\n", "Za = 6\n", "Zb = 0\n", "\n", "#Set polaization. 1 Unpolarized, 2 Polarized\n", "pol = 1\n", "\n", "Nmo = [[2],[1]]\n", "N = [[4],[2]]\n", "\n", "optKS = {\n", " \"interaction_type\" : \"dft\",\n", " \"SYM\" : False,\n", " \"FRACTIONAL\" : True,\n", " }\n", "\n", "#Grid Options\n", "NP = 7 #Number of points per block\n", "NM = [10,10] #Number of blocks [angular, radial]\n", "L = np.arccosh(15./a) #Maximum radial coordinate value\n", "loc = np.array(range(-4,5)) #Non inclusive on upper bound\n", "\n", "#Create and initialize grid object\n", "grid = Psgrid(NP, NM, a, L, loc)\n", "grid.initialize()\n", "\n", "#Kohn Sham object\n", "KS = Kohnsham(grid, Za, Zb, pol, Nmo, N, optKS)\n", "KS.scf()\n", "\n", "print(f\" Total Energy: {KS.E.E}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Compare againts Nist: Etot = -37.425749" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }