{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO:QMCTorch| ____ __ ______________ _\n", "INFO:QMCTorch| / __ \\ / |/ / ___/_ __/__ ________/ / \n", "INFO:QMCTorch|/ /_/ / / /|_/ / /__ / / / _ \\/ __/ __/ _ \\ \n", "INFO:QMCTorch|\\___\\_\\/_/ /_/\\___/ /_/ \\___/_/ \\__/_//_/ \n", "INFO:QMCTorch|\n", "INFO:QMCTorch|0.4.0\n" ] } ], "source": [ "import qmctorch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Jastrow Factor\n", "\n", "The wave function of the molecular system is written as :\n", "\n", "$$\n", "\\Psi(R) = J(R) \\sum_n c_n \\det(A_\\uparrow(r_\\uparrow)) \\det(A_\\downarrow(r_\\downarrow))\n", "$$\n", "\n", "where $J(R)$ is the so called Jastrow factor, and $A_\\uparrow$($A_\\downarrow$) is the matrix of the molecular orbitals values for the spin up(down) electron\n", "\n", "The Jastrow factor is written as the exponential of a kernel function :\n", "\n", "$$\n", "J(R) = \\exp\\left( \\sum_{i FullyConnectedJastrowKernel\n", "INFO:QMCTorch| Highest MO included : 6\n", "INFO:QMCTorch| Configurations : single_double(2,2)\n", "INFO:QMCTorch| Number of confs : 4\n", "INFO:QMCTorch| Kinetic energy : jacobi\n", "INFO:QMCTorch| Number var param : 2210\n", "INFO:QMCTorch| Cuda support : False\n" ] } ], "source": [ "import torch\n", "from qmctorch.scf import Molecule\n", "from qmctorch.wavefunction import SlaterJastrow\n", "from qmctorch.wavefunction.jastrows.elec_elec.kernels import PadeJastrowKernel, FullyConnectedJastrowKernel\n", "\n", "# define the molecule\n", "mol = Molecule(\n", " atom='Li 0 0 0; H 0 0 3.14',\n", " unit='bohr',\n", " calculator='pyscf',\n", " basis='sto-3g')\n", "\n", "\n", "# define the jastrow factor\n", "jastrow = JastrowFactorElectronElectron(\n", " mol,\n", " FullyConnectedJastrowKernel,\n", " kernel_kwargs={'size1': 32, 'size2': 64})\n", "\n", "# define the Slater Jastrow wavefunction\n", "wf = SlaterJastrow(mol,\n", " jastrow=jastrow,\n", " configs='single_double(2,2)')\n", "\n", "# define random electronic positions\n", "nbatch = 10\n", "pos = torch.rand(nbatch, mol.nelec * 3)\n", "\n", "# compute the value of the wave function\n", "wfval = wf(pos)" ] } ], "metadata": { "kernelspec": { "display_name": "qmctorch", "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.0" } }, "nbformat": 4, "nbformat_minor": 4 }