{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Hydrogen Exact" ] }, { "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 -0.50000 -5.00000e-01 +1.00000e+00\n", " 2 -0.50000 -5.00000e-01 +0.00000e+00\n", " Total Energy: -0.5000000176790201\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 = 1\n", "Zb = 0\n", "\n", "#Set polaization. 1 Unpolarized, 2 Polarized\n", "pol = 1\n", "\n", "Nmo = [[1]]\n", "N = [[1]]\n", "\n", "optKS = {\n", " \"interaction_type\" : \"ni\",\n", " \"SYM\" : False,\n", " \"fractional\" : True,\n", " }\n", "\n", "#Grid Options\n", "NP = 7 #Number of points per block\n", "NM = [4,4] #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}\")" ] } ], "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 }