Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
20f12bc
a few minor code simplifications and formatting in pyscf/tools
fchapoton May 8, 2026
45809ec
Merge pull request #3205 from fchapoton/details_in_tools
MatthewRHermes May 9, 2026
db2ec05
Better SG1 radii parameter for ghost atom
henryw7 May 8, 2026
60cd902
Correctly fallback to loading ECP from basis-set-exchange
allenjbTX May 6, 2026
c744d50
upgrade dispersion (#3209)
JiashuLiang May 14, 2026
f9ecb25
handle stderr on win
jeanwsr May 23, 2026
9fc6f99
Fix a batch of C-side correctness bugs across pbc, gto, vhf, dft, mcs…
susilehtola May 27, 2026
6badca8
fix cp2k basis missing bug
JiashuLiang Jun 1, 2026
f3754ed
Release 2.13.1 (#3232)
sunqm Jun 3, 2026
e020914
GW improvements: PBC G0W0 (#3222)
lijiachen417 Jun 5, 2026
4e32d3f
Load basis from BSE if elements are missing from .dat (#3240)
allenjbTX Jun 7, 2026
a20aac4
scf: fix init_guess_by_mod_huckel signature so it can be called witho…
Hongjiseung-ROK Jun 5, 2026
d6af026
use dll wrappers on windows (#3241)
jeanwsr Jun 7, 2026
8f0d691
Support complex orbitals in GCCSD; enable SOC Hamiltonian for GCCSD (…
sunqm Jun 8, 2026
4330efa
handle NamedTemporaryFile on windows (#3229)
jeanwsr Jun 10, 2026
b90df14
Loosen some tests in adc, gw and tdscf (#3247)
jeanwsr Jun 13, 2026
322e5fa
gto/ecp: fix premature convergence in radial quadrature at large expo…
susilehtola Jun 13, 2026
e25114c
Fix for full test on win (#3252)
jeanwsr Jun 13, 2026
547e935
fix: fixed memory over allocation in PCM gradients (fixes #3246)
oliver-s-lee Jun 12, 2026
6af52ea
Fixed KeyError for MM ECPs in project_to_atomic_orbitals (#3243)
ndolin Jun 15, 2026
d08d575
MC-PDFT unittests stabilize (#3245)
MatthewRHermes Jun 15, 2026
ec4fecc
cleanup
MatthewRHermes Jun 15, 2026
5afa952
Merge pull request #3263 from MatthewRHermes/issue_3245
MatthewRHermes Jun 16, 2026
cd7d8b4
Mc26 cof26 cf22d (#3251)
chen-yu-hao Jun 16, 2026
561a37e
Fix typo in lpdft (#3267)
MatthewRHermes Jun 17, 2026
747a3e6
Implement CABS Singles correction (#3265)
foxtran Jun 19, 2026
ebf164f
GW improvements: Bethe-Salpeter equation (#3228)
lijiachen417 Jun 21, 2026
47b37cb
RPA improvements: PBC RPA routines (#3239)
lijiachen417 Jun 21, 2026
90777cc
fix BSE example: clarify reference molecule/functional/geometry (#328…
lijiachen417 Jun 22, 2026
4d4f38f
use newer pyberny and numpy in ci (#3279)
jeanwsr Jun 22, 2026
7e062c8
Fix KSCF kmesh property (fix #3227)
sunqm Jun 20, 2026
385f0db
symmetry breaking via homo-lumo-mixing (#3271)
lynn-buehl Jun 23, 2026
58caac4
Handle molden file without Sym field (Fix #3233) (#3276)
sunqm Jun 23, 2026
6056f21
pbc/df: chunk kpt-pairs in CCGDFBuilder.outcore_auxe2 to avoid OOM (#…
gauravharsha Jun 23, 2026
2e5b231
High order cc improvements (#3255)
jinyuchem Jun 23, 2026
49e87cc
X2C Bug Fixes (#3280)
sunqm Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci_linux/deps_apt.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
sudo apt-get -qq install \
gcc \
g++ \
gfortran \
liblapack-dev \
libblas-dev \
cmake \
curl
11 changes: 5 additions & 6 deletions .github/workflows/ci_linux/python_deps.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env bash
python -m pip install --upgrade pip
pip install "numpy!=1.16,!=1.17" "scipy!=1.5" h5py pytest pytest-cov pytest-timer
pip install pyberny
pip install git+https://github.com/jhrmnn/pyberny.git@36a4be9
pip install --no-deps pyscf-dispersion==1.3.0
pip install geometric

version=$(python -c 'import sys; version=sys.version_info[:2]; print("{0}.{1}".format(*version))')
if [ $version != '3.12' ]; then
pip install geometric
pip install spglib
fi

if [ $version != '3.8' ]; then
if [ $version == '3.12' ]; then
pip install spglib
pip install pytblis
pip install git+https://github.com/sunqm/zquatev
fi

#cppe
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ version=$(python -c 'import sys; print("{0}.{1}".format(*sys.version_info[:2]))'
# pytest-cov on Python 3.12 consumes huge memory
if [ "$RUNNER_OS" == "Linux" ] && [ $version != "3.12" ]; then
pytest pyscf/ -s -c pytest.ini \
--durations=20 \
--cov-report xml --cov-report term --cov-config .coveragerc --cov pyscf
else
pytest pyscf/ -s -c pytest.ini pyscf
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
PySCF 2.13.1 (2026-06-01)
-------------------------
* Fixes
- Missing CP2K basis set data in wheel distributions
- Small-rotor error.
- Corrected SG1 grid radii handling for ghost atoms.
- Fixed ECP loading to correctly fall back to Basis Set Exchange when local data is unavailable.


PySCF 2.13.0 (2026-04-20)
-------------------------
* Added
Expand Down
8 changes: 6 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ include pyscf/lib/deps/lib*/libcint.[4-9].dylib
include pyscf/lib/deps/lib*/libxc.*.dylib
include pyscf/lib/deps/lib*/libxcfun.[2-9].dylib

# windows dynamic libraries
include pyscf/lib/*.dll
include pyscf/lib/deps/bin/*.dll

include pyscf/geomopt/log.ini
include pyscf/gto/basis/bse_meta.json

# CP2K basis set
include pyscf/lib/pbc/gto/basis/*BASIS*
include pyscf/lib/pbc/gto/pseudo/*POTENTIAL*
include pyscf/pbc/gto/basis/*BASIS*
include pyscf/pbc/gto/pseudo/*POTENTIAL*

# source code
recursive-include pyscf/lib *.c *.h CMakeLists.txt
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Python-based Simulations of Chemistry Framework
[![Build Status](https://github.com/pyscf/pyscf/workflows/CI/badge.svg)](https://github.com/pyscf/pyscf/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/pyscf/pyscf/branch/master/graph/badge.svg)](https://codecov.io/gh/pyscf/pyscf)

2026-04-20
2026-06-01

* [Stable release 2.13.0](https://github.com/pyscf/pyscf/releases/tag/v2.13.0)
* [Stable release 2.13.1](https://github.com/pyscf/pyscf/releases/tag/v2.13.1)
* [Changelog](../master/CHANGELOG)
* [Documentation](http://www.pyscf.org)
* [Installation](#installation)
Expand Down
25 changes: 18 additions & 7 deletions examples/2-benchmark/benchmarking_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@

def setup_logger():
log = pyscf.lib.logger.Logger(verbose=5)
with open('/proc/cpuinfo') as f:
for line in f:
if 'model name' in line:
log.note(line[:-1])
break
with open('/proc/meminfo') as f:
log.note(f.readline()[:-1])
try:
with open('/proc/cpuinfo') as f:
for line in f:
if 'model name' in line:
log.note(line[:-1])
break
except FileNotFoundError:
pass
try:
with open('/proc/meminfo') as f:
log.note(f.readline()[:-1])
except FileNotFoundError:
try:
import psutil
mem = psutil.virtual_memory()
log.note(f'MemTotal: {mem.total // 1024} kB')
except ImportError:
pass
log.note('OMP_NUM_THREADS=%s\n', os.environ.get('OMP_NUM_THREADS', None))
return log

Expand Down
4 changes: 2 additions & 2 deletions examples/ao2mo/01-outcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Author: Qiming Sun <osirpt.sun@gmail.com>
#

import tempfile
import h5py
from pyscf import gto, scf, ao2mo
from pyscf import lib

'''
Save the transformed integrals in the given file in HDF5 format
Expand All @@ -22,7 +22,7 @@
myhf.kernel()

orb = myhf.mo_coeff
ftmp = tempfile.NamedTemporaryFile()
ftmp = lib.NamedTemporaryFile()
print('MO integrals are saved in file %s under dataset "eri_mo"' % ftmp.name)
ao2mo.kernel(mol, orb, ftmp.name)

Expand Down
4 changes: 2 additions & 2 deletions examples/ao2mo/10-diff_orbs_for_ijkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Author: Qiming Sun <osirpt.sun@gmail.com>
#

import tempfile
import numpy
import h5py
from pyscf import gto, scf, ao2mo
from pyscf import lib

'''
Integral transformation for four different orbitals
Expand Down Expand Up @@ -39,7 +39,7 @@
#
# Given four MOs, compute the MO-integrals and saved in dataset "mp2_bz"
#
eritmp = tempfile.NamedTemporaryFile()
eritmp = lib.NamedTemporaryFile()
nocc = mol.nelectron // 2
nvir = len(mf.mo_energy) - nocc
co = mf.mo_coeff[:,:nocc]
Expand Down
1 change: 0 additions & 1 deletion examples/ao2mo/11-ump2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Author: Qiming Sun <osirpt.sun@gmail.com>
#

import tempfile
import numpy
import h5py
from pyscf import gto, scf, ao2mo
Expand Down
6 changes: 3 additions & 3 deletions examples/ao2mo/20-eri_grad_hess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Author: Qiming Sun <osirpt.sun@gmail.com>
#

import tempfile
import numpy
import h5py
from pyscf import gto, scf, ao2mo
from pyscf import lib

'''
Integral transformation for irregular operators
Expand All @@ -28,7 +28,7 @@
#
# Given four MOs, compute the MO-integral gradients
#
gradtmp = tempfile.NamedTemporaryFile()
gradtmp = lib.NamedTemporaryFile()
nocc = mol.nelectron // 2
nvir = len(mf.mo_energy) - nocc
co = mf.mo_coeff[:,:nocc]
Expand Down Expand Up @@ -56,7 +56,7 @@
# 9 d/dZ d/dZ
#
orb = mf.mo_coeff
hesstmp = tempfile.NamedTemporaryFile()
hesstmp = lib.NamedTemporaryFile()
ao2mo.kernel(mol, orb, hesstmp.name, intor='cint2e_ipvip1_sph',
dataname='hessints1', aosym='s4')
with ao2mo.load(hesstmp, 'hessints1') as eri:
Expand Down
3 changes: 1 addition & 2 deletions examples/ao2mo/22-rkb_no_pair_ints.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pyscf import scf
from pyscf import lib
from pyscf.ao2mo import r_outcore
import tempfile
import os

mol = gto.M(
Expand Down Expand Up @@ -53,7 +52,7 @@ def no_pair_ovov(mol, mo_coeff, erifile):

def run_and_add(mol, mos, erifile, dataname_main, intor):
# Use a temporary file for the intermediate integrals
with tempfile.NamedTemporaryFile(suffix=".h5", delete=False) as tmpfile:
with lib.NamedTemporaryFile(suffix=".h5", delete=False) as tmpfile:
tmp_erifile = tmpfile.name

try:
Expand Down
44 changes: 44 additions & 0 deletions examples/cc/03-gccsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python

'''
GCCSD: CCSD based on the GHF reference.

The cluster amplitudes of GCCSD are represented in the spin-orbital basis and
are solved without assuming spin symmetry. GCCSD can be applied to spin-orbit
coupled systems.

For non-relativistic calculations, GCCSD is typically equivalent to the
corresponding UHF-CCSD calculation. When spin-orbit coupling (SOC) is included,
for example, the X2C Hamiltonian (see examples/x2c/03-x2c_ghf.py) or SOC-ECP
(see examples/scf/44-soc_ecp.py), the GHF orbitals become complex-valued, and
the resulting GCCSD amplitude are also complex-valued.
'''

import pyscf

mol = pyscf.M(atom='''
O 0. 0. 0.
H 0. -0.757 0.587
H 0. 0.757 0.587''',
basis='cc-pvdz')
#
# Non-relativistic calculation. The CCSD object returned by mf.CCSD() is an
# instance of the GCCSD class. The cluster amplitudes are represented in the
# spin-orbital basis.
#
mf = mol.GHF().run()
mycc = mf.CCSD().run()

#
# Enable SOC via the X2C Hamiltonian. GCCSD amplitudes are complex-valued.
#
mf = mol.GHF().x2c().run()
mycc = mf.CCSD().run()

#
# For calculations using ECPs, SOC can be enabled with the setting
# mf.with_soc = True
#
# Running mf.CCSD() on such a reference will performs a GCCSD calculation
# with complex-valued amplitudes.
#
2 changes: 1 addition & 1 deletion examples/cc/61-rccsdtq.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
mycc2.verbose = 5
mycc2.incore_complete = True
mycc2.kernel()
print('Full-T4 RCCSDQ e_corr % .12f Ref % .12f Diff % .12e' % (
print('Full-T4 RCCSDTQ e_corr % .12f Ref % .12f Diff % .12e' % (
mycc2.e_corr, ref_e_corr, mycc2.e_corr - ref_e_corr))

#
Expand Down
2 changes: 1 addition & 1 deletion examples/cc/63-check_rccsdt_uccsdt_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

# Restart UCCSDT using amplitudes converted from RCCSDT
tamps_init_uhf = [t1_rhf2uhf, t2_rhf2uhf, t3_rhf2uhf]
myucc2 = cc.UCCSDT(mf, compact_tamps=False).set(conv_tol=1e-10, conv_tol_normt=1e-8, verbose=5)
myucc2 = cc.UCCSDT(mf_uhf, compact_tamps=False).set(conv_tol=1e-10, conv_tol_normt=1e-8, verbose=5)
myucc2.kernel(tamps=tamps_init_uhf)
print('UCCSDT correlation energy % .12f Ref % .12f Diff % .12e' % (
myucc2.e_corr, -0.2188784727114157, myucc2.e_corr - -0.2188784727114157))
1 change: 0 additions & 1 deletion examples/cc/64-chained_rccsd_rccsdt_rccsdtq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- Examine the influence of DIIS acceleration on convergence.
'''

import numpy as np
from pyscf import gto, scf, cc

def run_rccsd_rccsdt_rccsdtq(do_diis=False, do_diis_max_t=False, verbose=0):
Expand Down
5 changes: 2 additions & 3 deletions examples/cc/65-chained_uccsd_uccsdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- Understand and handle the difference in T2 amplitude conventions between UCCSD and UCCSDT implementations.
'''

import numpy as np
from pyscf import gto, scf, cc

def run_uccsd_uccsdt(do_diis=False, do_diis_max_t=False, verbose=0):
Expand All @@ -32,7 +31,7 @@ def run_uccsd_uccsdt(do_diis=False, do_diis_max_t=False, verbose=0):
myccsd.verbose = verbose
myccsd.diis = do_diis
myccsd.kernel()
print('RCCSD e_corr % .12f Ref % .12f Diff % .12e' % (
print('UCCSD e_corr % .12f Ref % .12f Diff % .12e' % (
myccsd.e_corr, ref_ccsd_e_corr, myccsd.e_corr - ref_ccsd_e_corr))

# UCCSDT
Expand Down Expand Up @@ -99,7 +98,7 @@ def run_uccsd_uccsdt(do_diis=False, do_diis_max_t=False, verbose=0):
do_diis_max_t = False
run_uccsd_uccsdt(do_diis=do_diis, do_diis_max_t=do_diis_max_t)

print('=== UCCSD / UCCSDT with DIIS (including T3 amplitudes) ===')
print('=== UCCSD -> UCCSDT with DIIS (including T3 amplitudes) ===')
do_diis = True
do_diis_max_t = True
run_uccsd_uccsdt(do_diis=do_diis, do_diis_max_t=do_diis_max_t)
59 changes: 59 additions & 0 deletions examples/cc/66-rccsdt_q.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python
#
# Author: Yu Jin <yjin@flatironinstitute.org>
#

'''
Examples of RCCSDT(Q) calculations.

This script demonstrates:
- Consistency of the [Q] and (Q) energy corrections on top of RCCSDT between calculations
using full and compact T3 storage.
'''

from pyscf import gto, scf, cc

mol = gto.M(atom='H 0 0 0; F 0 0 1.1', basis='ccpvdz')
mf = scf.RHF(mol)
mf.conv_tol = 1e-14
mf.kernel()

# Reference CCSDT correlation energy, and [Q] and (Q) energy correction
ref_e_corr = -0.2188784733230733
ref_e_q_bracket = -0.0005026220700017348
ref_e_q_paren = -0.0005490746450078632

mycc1 = cc.RCCSDT(mf, compact_tamps=True)
mycc1.conv_tol = 1e-10
mycc1.conv_tol_normt = 1e-8
mycc1.verbose = 5
# einsum_backend: numpy (default) | pyscf | pytblis (recommended)
# pytblis can be installed via `pip install pytblis==0.05` (See https://github.com/chillenb/pytblis)
mycc1.set_einsum_backend('pyscf')
mycc1.incore_complete = True
mycc1.kernel()
e_q_bracket, e_q_paren = mycc1.ccsdt_q()
print('Triangular RCCSDT e_corr % .12f Ref % .12f Diff % .12e' % (
mycc1.e_corr, ref_e_corr, mycc1.e_corr - ref_e_corr))
print('Triangular RCCSDT [Q] % .12f Ref % .12f Diff % .12e' % (
e_q_bracket, ref_e_q_bracket, e_q_bracket - ref_e_q_bracket))
print('Triangular RCCSDT (Q) % .12f Ref % .12f Diff % .12e' % (
e_q_paren, ref_e_q_paren, e_q_paren - ref_e_q_paren))

#
# RCCSDT with full T3 storage
# Same as cc.rccsdt_highm.RCCSDT
#
mycc2 = cc.RCCSDT(mf, compact_tamps=False)
mycc2.conv_tol = 1e-10
mycc2.conv_tol_normt = 1e-8
mycc2.verbose = 5
mycc2.incore_complete = True
mycc2.kernel()
q_bracket2, q_paren2 = mycc2.ccsdt_q()
print('Full-T3 RCCSDT e_corr % .12f Ref % .12f Diff % .12e' % (
mycc2.e_corr, ref_e_corr, mycc2.e_corr - ref_e_corr))
print('Full-T3 RCCSDT [Q] % .12f Ref % .12f Diff % .12e' % (
q_bracket2, ref_e_q_bracket, q_bracket2 - ref_e_q_bracket))
print('Full-T3 RCCSDT (Q) % .12f Ref % .12f Diff % .12e' % (
q_paren2, ref_e_q_paren, q_paren2 - ref_e_q_paren))
1 change: 0 additions & 1 deletion examples/df/01-auxbasis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
See also examples/gto/04-input_basis.py
'''

import tempfile
from pyscf import gto, scf, df

#
Expand Down
4 changes: 2 additions & 2 deletions examples/df/40-precompute_df_integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
reused many times.
'''

import tempfile
from pyscf import gto, scf, df
from pyscf import lib
from pyscf.pbc import gto as pgto
from pyscf.pbc import dft as pdft

tmpf = tempfile.NamedTemporaryFile()
tmpf = lib.NamedTemporaryFile()
file_to_save_df_ints = tmpf.name
print('DF integral is saved in %s' % file_to_save_df_ints)

Expand Down
Loading