Python Simulations of Chemistry Framework
Board of Directors
Maintainers
Special forms (e.g. sparsity of V) are rarely exploited.
PySCF calculates \(h_{pq} \) and \( V_{pqrs} \) or users can provide them
Several basis options: Gaussian-type orbitals (GTOs) for molecules and solids and plane-wave
-----------------------------------------------|---------
Language files blank comment | code
-----------------------------------------------|---------
Python 1145 38662 52046 | 192523
C 66 3006 2779 | 43508
reStructuredText 48 1414 541 | 4074
Lisp 5 78 145 | 886
C/C++ Header 18 176 253 | 640
YAML 7 25 61 | 302
CMake 11 63 189 | 247
...
-----------------------------------------------|---------
SUM: 1328 43546 56085 | 242730
-----------------------------------------------|---------
from pyscf import gto, scf, cc
# Setup molecule
mol = gto.Mole()
mol.atom = """
C 0.00 0.00 0.00
C 1.68 1.68 1.68"""
mol.basis = "cc-pvdz"
mol.build()
# Run HF
my_mf = scf.HF(mol)
hf_energy = my_mf.kernel()
# Run Coupled Cluster
my_cc = cc.CCSD(my_mf)
cc_energy = cc.kernel()
from pyscf.pbc import gto, scf, cc
# Setup molecule
cell = gto.Mole()
cell.a = """
0.00 3.37 3.37
3.37 0.00 3.37
3.37 3.37 0.00"""
cell.atom = """
C 0.00 0.00 0.00
C 1.68 1.68 1.68"""
cell.basis = "cc-pvdz"
#cell.pseudo = "gth-pade"
cell.build()
# Run HF
cell.make_kpts([2,2,2])
my_mf = scf.HF(cell, kpts)
hf_energy = my_mf.kernel()
# Run Coupled Cluster
my_cc = cc.KCCSD(my_mf)
cc_energy = cc.kernel()
We have a lot of correlated methods that work well in molecules and solids
Xiao Wang
Hongzhou Ye and Verena Neufeld
h1 = numpy.zeros((n,n))
for i in range(n-1):
h1[i,i+1] = h1[i+1,i] = -1.0
h1[n-1,0] = h1[0,n-1] = -1.0
eri = numpy.zeros((n,n,n,n))
for i in range(n):
eri[i,i,i,i] = 2.0
mf = scf.RHF(mol)
mf.get_hcore = lambda *args: h1
mf.get_ovlp = lambda *args: numpy.eye(n)
mf.kernel()
mymp = mp.MP2(mf)
mymp.kernel()
mycc = cc.CCSD(mf)
mycc.kernel()
mycas = mcscf.CASSCF(mf, 4, 4)
mycas.kernel()
Option 1: Using pip
pip install pyscf
Option 2: Using pip
to installing the latest version
pip install -e git+https://github.com/pyscf/pyscf.git
Option 3: Build PySCF from sources
Requirements:
git clone https://github.com/pyscf/pyscf.git
cd pyscf/pyscf/lib
cmake -B build
cmake --build build --parallel
Over 350 examples!!
https://github.com/jamesETsmith/2022_simons_collab_pyscf_workshop
EXTRA SLIDES