Skip to content

Commit

Permalink
Merge remote-tracking branch 'pyscf/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zc62 committed May 10, 2024
2 parents 28cabc6 + 940e4ac commit 64c88bc
Show file tree
Hide file tree
Showing 261 changed files with 18,758 additions and 1,393 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: |
docker run --rm -v ${{ github.workspace }}:/src/pyscf:rw --workdir=/src/pyscf ${{ env.img }} \
bash -exc '/opt/python/${{ matrix.pyver }}/bin/pip install --upgrade pip setuptools && \
/opt/python/${{ matrix.pyver }}/bin/pip install "numpy!=1.16,!=1.17" "scipy!=1.5" h5py pytest pytest-cov pytest-timer pyberny geometric && \
/opt/python/${{ matrix.pyver }}/bin/pip install "numpy!=1.16,!=1.17" "scipy!=1.5" h5py==3.10 pytest pytest-cov pytest-timer pyberny geometric && \
yum install -y epel-release && \
yum-config-manager --enable epel && \
yum install -y openblas-devel gcc cmake curl && \
Expand All @@ -72,7 +72,7 @@ jobs:
echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > .pyscf_conf.py && \
echo "dftd3_DFTD3PATH = './pyscf/lib/deps/lib'" >> .pyscf_conf.py && \
echo "scf_hf_SCF_mute_chkfile = True" >> .pyscf_conf.py && \
ulimit -s 20000 && /opt/python/${{ matrix.pyver }}/bin/pytest pyscf/ --ignore=pyscf/adc --ignore=pyscf/pbc/df --ignore=pyscf/pbc/cc -s -c setup.cfg pyscf'
ulimit -s 20000 && /opt/python/${{ matrix.pyver }}/bin/pytest pyscf/ --ignore=pyscf/adc --ignore=pyscf/pbc/df --ignore=pyscf/pbc/cc -s -c pytest.ini pyscf'
macos-build:
runs-on: macos-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci_linux/python_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
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 --no-deps pyscf-dispersion

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
pip install dftd3
pip install dftd4
fi

#cppe
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_macos/deps_apt.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#!/usr/bin/env bash
exit 0
11 changes: 9 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
- uses: actions/checkout@v3
- name: Build wheels
run: |
docker run --rm -v ${{ github.workspace }}:/src/pyscf pyscf/pyscf-pypa-env:latest \
docker run --rm -v ${{ github.workspace }}:/src/pyscf \
-e CMAKE_BUILD_PARALLEL_LEVEL=4 \
pyscf/pyscf-pypa-env:latest \
bash /src/pyscf/docker/pypa-env/build-wheels.sh
- name: List available wheels
run: |
Expand Down Expand Up @@ -57,6 +59,7 @@ jobs:
export src=${GITHUB_WORKSPACE:-/src/pyscf} && \
export dst=${GITHUB_WORKSPACE:-/src/pyscf}/linux-wheels && \
export CMAKE_CONFIGURE_ARGS="-DWITH_F12=OFF" && \
export CMAKE_BUILD_PARALLEL_LEVEL=4 && \
mkdir -p /root/wheelhouse $src/linux-wheels && \
sed -i "/ if basename(fn) not in needed_libs:/s/basename.*libs/1/" /opt/_internal/pipx/venvs/auditwheel/lib/python*/site-packages/auditwheel/wheel_abi.py && \
/opt/python/${{ matrix.pyver }}/bin/pip wheel -v --no-deps --no-clean -w /root/wheelhouse $src && \
Expand All @@ -82,7 +85,8 @@ jobs:
- uses: actions/checkout@v3
- name: Build sdist
run: |
python3 setup.py sdist
pip install build
python3 -m build -s
- name: List available sdist
run: |
ls ${{ github.workspace }}/dist
Expand All @@ -108,6 +112,7 @@ jobs:
CIBW_BUILD: cp311-macosx_x86_64
CIBW_BUILD_VERBOSITY: "1"
CMAKE_CONFIGURE_ARGS: "-DWITH_F12=OFF"
CMAKE_BUILD_PARALLEL_LEVEL: "4"
with:
output-dir: mac-wheels
- name: List available wheels
Expand All @@ -133,6 +138,7 @@ jobs:
# Cross-platform build for arm64 wheels on x86 platform
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CMAKE_CONFIGURE_ARGS: "-DWITH_F12=OFF"
CMAKE_BUILD_PARALLEL_LEVEL: "4"
CMAKE_OSX_ARCHITECTURES: arm64
with:
output-dir: mac-wheels
Expand Down Expand Up @@ -161,6 +167,7 @@ jobs:
- run: which python
- name: Publish to conda
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=4
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
conda install -y anaconda-client conda-build
conda config --set anaconda_upload yes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ echo "scf_hf_SCF_mute_chkfile = True" >> .pyscf_conf.py
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 setup.cfg \
pytest pyscf/ -s -c pytest.ini \
--cov-report xml --cov-report term --cov-config .coveragerc --cov pyscf
else
pytest pyscf/ -s -c setup.cfg pyscf
pytest pyscf/ -s -c pytest.ini pyscf
fi
29 changes: 29 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
PySCF 2.5.0 (2024-02-03)
------------------------
* Added
- SA-CASSCF Nonadiabatic Coupling Vectors
- The to_gpu function to convert pyscf objects to gpu4pyscf objects.
- 4th, and 5th order XC derivatives.
* Improved
- DIIS with damping for gapless systems.
- CPHF solver with level shift for gapless systems.
- The memory footprint for rsdf_builder and rsjk_builder.
- Use UHF natural orbital for RHF chkfile initial guess.
- Pipek Mezey + Stability check using Jacobi sweep.
- The conversion between FCI strings and addresses for more than 64 orbitals.
- The interface to the dftd3 and dftd4 dispersion correction modules.
- Switch off the sparsity treatment in DFT numerical integration for small system.
- Lattice-sum cutoff for non-orthogonal cell.
- Allow turning off AO symmetry for PBC DFT.
* Fixes
- cp2k basis parsers
- k2gamma for dft classes.
- Mole.magmom attribute serialization error.
- post-hf Gradients with Cartesian GTOs.
- Basis order problem in molden.load .
- PBC DFT Becke grids rounding error.
- PBC rsdf for un-sorted basis.
- The get_bands function with k-point symmetry.


PySCF 2.4.0 (2023-10-16)
------------------------
* Added
Expand Down Expand Up @@ -37,6 +65,7 @@ PySCF 2.4.0 (2023-10-16)
- Assume 46 and 78 core configurations to be f-in-valence.
- Coding styles and deprecated warnings from numpy.


PySCF 2.3.0 (2023-07-04)
------------------------
* Added
Expand Down
6 changes: 5 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ Xiaojie Wu
Pavel Pokhilko
Frédéric Chapoton
Daniel King

Jiachen Li
Felipe S. S. Schneider
Aniruddha Seal
Peter Reinholdt
Christopher Hillenbrand


---
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)

2023-10-15
2024-02-03

* [Stable release 2.4.0](https://github.com/pyscf/pyscf/releases/tag/v2.4.0)
* [Stable release 2.5.0](https://github.com/pyscf/pyscf/releases/tag/v2.5.0)
* [Changelog](../master/CHANGELOG)
* [Documentation](http://www.pyscf.org)
* [Installation](#installation)
Expand Down
2 changes: 1 addition & 1 deletion conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export CMAKE_CONFIGURE_ARGS="-DWITH_F12=OFF -DBLA_VENDOR=Intel10_64lp_seq"

# env PYTHON not defined in certain conda-build version
# $PYTHON -m pip install . -vv
pip install -v --prefix=$PREFIX .
MAKEFLAGS="-j4" pip install -v --prefix=$PREFIX .
10 changes: 10 additions & 0 deletions examples/dft/00-simple_dft.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@

# Orbital energies, Mulliken population etc.
mf.analyze()

# shorten dft names
mf = mol.KS(xc='b3lyp-d3bj')
#mf = mol.KS(xc='b3lyp-d3zero')
#mf = mol.KS(xc='b3lyp-d3bj2b')
#mf = mol.KS(xc='b3lyp-d3bjatm')
#mf = mol.KS(xc='b3lyp-d4')
#mf = mol.KS(xc='wb97x-v')
#mf = mol.KS(xc='wb97m-d3bj)
#mf = mol.KS(xc='wb97x-d3)
32 changes: 32 additions & 0 deletions examples/gw/03-drpa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'''
Direct RPA correlation energy
'''

from pyscf import gto, dft, gw

mol = gto.M(
atom = """
O 0.48387 -0.41799 -0.63869
H 0.58103 0.36034 -0.05009
H 1.01598 -1.09574 -0.18434
H 0.68517 -2.88004 0.87771
O 1.59649 -2.63873 0.61189
H 1.72242 -3.22647 -0.15071
H -2.47665 1.59686 -0.33246
O -1.55912 1.35297 -0.13891
H -1.25777 0.82058 -0.89427
H -1.87830 -2.91357 -0.21825
O -1.14269 -2.57648 0.31845
H -0.81003 -1.77219 -0.15155
""",
basis = 'ccpvqz', verbose = 5,
)

mf = dft.RKS(mol).density_fit()
mf.xc = 'pbe'
mf.kernel()

import pyscf.gw.rpa
rpa = gw.rpa.dRPA(mf)
rpa.max_memory = 50
rpa.kernel()
90 changes: 90 additions & 0 deletions examples/nac/01-sacasscf_nac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
from pyscf import gto, scf, mcscf, lib

# NAC signs are really, really hard to nail down.
# There are arbitrary signs associated with
# 1. The MO coefficients
# 2. The CI vectors
# 3. Almost any kind of post-processing (natural-orbital analysis, etc.)
# 4. Developer convention on whether the bra index or ket index is 1st
# It MIGHT help comparison to OpenMolcas if you load a rasscf.h5 file
# I TRIED to choose the same convention for #4 as OpenMolcas.
mol = gto.M (atom='Li 0 0 0;H 1.5 0 0', basis='sto-3g',
output='LiH_sa2casscf22_sto3g.log', verbose=lib.logger.INFO)

mf = scf.RHF (mol).run ()
mc = mcscf.CASSCF (mf, 2, 2)
mc.fix_spin_(ss=0, shift=1)
mc = mc.state_average ([0.5,0.5]).run (conv_tol=1e-10)

mc_nacs = mc.nac_method()

# 1. <1|d0/dR>
# Equivalent OpenMolcas input:
# ```
# &ALASKA
# NAC=1 2
# ```
nac = mc_nacs.kernel (state=(0,1))
print ("\nNAC <1|d0/dR>:\n", nac)
print ("Notice that according to the NACs printed above, rigidly moving the")
print ("molecule along the bond axis changes the electronic wave function, which")
print ("is obviously unphysical. This broken translational symmetry is due to the")
print ("'CSF contribution'. Omitting the CSF contribution corresponds to using the")
print ("'electron-translation factors' of Fatehi and Subotnik and is requested by")
print ("passing 'use_etfs=True'.")

# 2. <1|d0/dR> w/ ETFs (i.e., w/out CSF contribution)
# Equivalent OpenMolcas input:
# ```
# &ALASKA
# NAC=1 2
# NOCSF
# ```
nac = mc_nacs.kernel (state=(0,1), use_etfs=True)
print ("\nNAC <1|d0/dR> w/ ETFs:\n", nac)
print ("These NACs are much more well-behaved: moving the molecule rigidly around")
print ("in space doesn't induce any change to the electronic wave function.")

# 3. <0|d1/dR>
# Equivalent OpenMolcas input:
# ```
# &ALASKA
# NAC=2 1
# ```
nac = mc_nacs.kernel (state=(1,0))
print ("\nThe NACs are antisymmetric with respect to state transposition.")
print ("NAC <0|d1/dR>:\n", nac)

# 4. <0|d1/dR> w/ ETFs
# Equivalent OpenMolcas input:
# ```
# &ALASKA
# NAC=2 1
# NOCSF
# ```
nac = mc_nacs.kernel (state=(1,0), use_etfs=True)
print ("NAC <0|d1/dR> w/ ETFs:\n", nac)

# 5. <1|d0/dR>*(E1-E0) = <0|d1/dR>*(E0-E1)
# I'm not aware of any OpenMolcas equivalent for this, but all the information
# should obviously be in the output file, as long as you aren't right at a CI.
nac_01 = mc_nacs.kernel (state=(0,1), mult_ediff=True)
nac_10 = mc_nacs.kernel (state=(1,0), mult_ediff=True)
print ("\nNACs diverge at conical intersections (CI). The important question")
print ("is how quickly it diverges. You can get at this by calculating NACs")
print ("multiplied by the energy difference using the keyword 'mult_ediff=True'.")
print ("This yields a quantity which is symmetric wrt state interchange and is")
print ("finite at a CI.")
print ("NAC <1|d0/dR>*(E1-E0):\n", nac_01)
print ("NAC <0|d1/dR>*(E0-E1):\n", nac_10)

# 6. <1|d0/dR>*(E1-E0) w/ETFs = <0|d1/dR>*(E0-E1) w/ETFs = <0|dH/dR|1>
# This is the quantity one uses to optimize MECIs
v01 = mc_nacs.kernel (state=(0,1), use_etfs=True, mult_ediff=True)
v10 = mc_nacs.kernel (state=(1,0), use_etfs=True, mult_ediff=True)
print ("\nUsing both 'use_etfs=True' and 'mult_ediff=True' corresponds to the")
print ("derivative of the off-diagonal element of the potential matrix. This")
print ("tells you one of the two components of the branching plane at the CI.")
print ("<1|d0/dR>*(E1-E0) w/ ETFs = <1|dH/dR|0>:\n", v01)
print ("<0|d1/dR>*(E0-E1) w/ ETFs = <0|dH/dR|1>:\n", v10)

4 changes: 2 additions & 2 deletions examples/pbc/27-multigrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#
# There are two ways to enable multigrid numerical integration
#
# Method 1: use multigrid.multigrid function to update SCF object
# Method 1: use multigrid.multigrid_fftdf function to update SCF object
#
mf = multigrid.multigrid(mf)
mf = multigrid.multigrid_fftdf(mf)
mf.kernel()

#
Expand Down
Loading

0 comments on commit 64c88bc

Please sign in to comment.