PySCF: Python-based Simulations of Chemistry Framework

2.12.1 · active · verified Thu Apr 16

PySCF is an open-source, Python-based framework for *ab initio* quantum chemistry simulations. It offers a comprehensive suite of electronic structure methods, including Hartree-Fock, Density Functional Theory (DFT), MP2, Coupled Cluster, and various multi-reference methods, for both molecular and periodic systems. The library is actively developed, with version 2.12.1 being the current stable release, and minor versions released roughly every 3-4 months, indicating a robust and ongoing development cycle.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart defines a water molecule using the `gto` module and then performs a Restricted Hartree-Fock (RHF) calculation using the `scf` module. It demonstrates the basic workflow of defining a system and running a mean-field calculation, printing the total energy.

from pyscf import gto, scf

# Define a molecule (e.g., Water)
mol = gto.M(
    atom = 'O 0 0 0; H 0 0.757 0.587; H 0 -0.757 0.587',
    basis = 'sto-3g')

# Perform a Restricted Hartree-Fock (RHF) calculation
mf = scf.RHF(mol).run()

# Print the RHF energy
print(f'RHF Energy: {mf.e_tot} Hartree')

view raw JSON →