Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c95c726
fix compatibility with pyscf 2.0.1 by explicitly writing the unique_w…
gauravharsha Aug 27, 2025
13adf37
Create python-package.yml
gauravharsha Aug 30, 2025
ae2e734
Update python-package.yml
gauravharsha Aug 30, 2025
0e44adb
debug python-project.yml
gauravharsha Aug 30, 2025
dda25eb
update python app test dependencies
gauravharsha Aug 30, 2025
e91e736
disable linting
gauravharsha Aug 30, 2025
c00b48e
add scipy version that satisfies new and old pyscf linalg_helper
gauravharsha Aug 30, 2025
93d7c41
update version number
gauravharsha Aug 30, 2025
e92795b
modify scipy dependencies and order of python package testing
gauravharsha Aug 30, 2025
a7f0119
fix python package testing workflow
gauravharsha Aug 31, 2025
aab2738
same old - fix workflow
gauravharsha Aug 31, 2025
36f59a1
workflow tweaks
gauravharsha Aug 31, 2025
e1d9e27
control testing workflow dependencies
gauravharsha Aug 31, 2025
4fd4261
fix typo in workflow
gauravharsha Aug 31, 2025
0cb2baf
scipy version fix
gauravharsha Aug 31, 2025
5332d6f
scipy compatibility in linalg_helper.py
gauravharsha Aug 31, 2025
5581bd9
modify python package testing workflow
gauravharsha Aug 31, 2025
c7d1e8f
remove control over scipy in requirements
gauravharsha Aug 31, 2025
cdc8118
update workflow file
gauravharsha Aug 31, 2025
5bffdfc
re-edit pyproject.toml
gauravharsha Aug 31, 2025
bd39893
fix if condition in workflow
gauravharsha Aug 31, 2025
8c9d8ce
updates to fix tests in Github
gauravharsha Sep 9, 2025
1b0575f
resolve scipy discrepancy
gauravharsha Sep 10, 2025
3178a4c
for older pyscf, downgrade scs and cvxpy versions
gauravharsha Sep 10, 2025
f32dfe8
update scipy installation for pyscf 2.0.1
gauravharsha Sep 10, 2025
ab413de
modify installation of requirements
gauravharsha Sep 10, 2025
8b70e7f
one more try to fix link and installation checks
gauravharsha Sep 10, 2025
1d265b2
fix scs version for workflow
gauravharsha Sep 11, 2025
9c86e05
reintroduce lapack and blas
gauravharsha Sep 11, 2025
01dac92
fix distutils error
gauravharsha Sep 11, 2025
8744167
handle distutils dependency
gauravharsha Sep 11, 2025
c8682fa
remove copilot's faulty suggestions
gauravharsha Sep 11, 2025
9acd7e2
remove distutils installation altogether
gauravharsha Sep 11, 2025
8a8479f
remove upgrade strategy things with installation of igen
gauravharsha Sep 11, 2025
462401e
address library tweaks
gauravharsha Sep 11, 2025
19546ec
distutils still gives an error
gauravharsha Sep 11, 2025
e72e703
link quadmath lib
gauravharsha Sep 12, 2025
75273c7
check if scs 3.2.0 fixes error with python 11
gauravharsha Sep 12, 2025
c8bf15a
cherry pick scs and cvxpy versions for python 3.11
gauravharsha Sep 12, 2025
e35216b
handle quadmath across platforms
gauravharsha Sep 13, 2025
c7ccd49
minor fix in cmake
gauravharsha Sep 14, 2025
fcfa630
fix syntax for target_link_libraries
gauravharsha Sep 14, 2025
d06dad6
Merge pull request #1 from gauravharsha/debug
gauravharsha Sep 14, 2025
408a4a7
fix assume_a parameter in scipy linalg helper
gauravharsha Sep 14, 2025
b1ef670
update author list email
gauravharsha Sep 14, 2025
73cdec9
cleanup
gauravharsha Sep 14, 2025
8d24eed
fix email id typo
gauravharsha Sep 15, 2025
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
62 changes: 62 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
pyscf-version:
- "git+https://github.com/cnyeh/pyscf.git@x2c1e_kpoints"
- "pyscf"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install libblas-dev liblapack-dev libeigen3-dev libgmp-dev libmpfr-dev libfftw3-dev libhdf5-dev
sudo apt install build-essential
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip
python -m pip install flake8 pytest numpy h5py
pip install --upgrade-strategy only-if-needed ${{ matrix.pyscf-version }}
- name: Install package
run: |
python -m pip install .
- name: Tweak library versions
run: |
if [ ${{ matrix.pyscf-version }} = "git+https://github.com/cnyeh/pyscf.git@x2c1e_kpoints" ]; then
pip install --upgrade "scipy<1.11.0";
pip install "scs==3.2.3";
pip install "cvxpy==1.4"
fi
- name: Install Green-MBTools and Test igen
run: |
pip install --upgrade-strategy only-if-needed green-mbtools
python -c "import scipy; print('Scipy version: ', scipy.__version__)"
cd ../
git clone https://github.com/green-phys/green-mbtools
cd green-mbtools/tests
pytest -v
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ set(MIN_EXPCUTOFF ${libcint_MIN_EXPCUTOFF})
set(KEEP_GOING ${libcint_KEEP_GOING})
set(CMAKE_C_CREATE_SHARED_LIBRARY ${libcint_CMAKE_C_CREATE_SHARED_LIBRARY})

check_library_exists(quadmath logq "" HAVE_LIBQUADMATH)
check_include_file("quadmath.h" HAVE_QUADMATH_H)

add_subdirectory(src)
add_library(GREEN::IGEN ALIAS pbc0)
add_dependencies(pbc0 cint)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ cmake.verbose = true

[project]
name = "green-igen"
version = "0.2.6"
version = "0.2.7"
authors = [
{ name="Sergei Iskakov", email="siskakov@umich.edu" },
{ name="Sergei Iskakov" },
{ name="Gaurav Harsha", email="gharsha@umich.edu" },
]

dependencies = ["numpy", "h5py", "scipy", "pyscf"]
Expand Down
17 changes: 14 additions & 3 deletions python/green_igen/df.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
from pyscf.pbc.df import df_ao2mo
from pyscf.pbc.df.aft import get_nuc
from pyscf.pbc.df.df_jk import zdotCN
from pyscf.pbc.lib.kpts_helper import (is_zero, gamma_point, member, unique, unique_with_wrap_around,
KPT_DIFF_TOL)
from pyscf.pbc.df.aft import _sub_df_jk_
from pyscf.pbc.lib.kpts_helper import (is_zero, gamma_point, member, unique, KPT_DIFF_TOL)
from pyscf import __config__

LINEAR_DEP_THR = getattr(__config__, 'pbc_df_df_DF_lindep', 1e-9)
Expand All @@ -66,6 +64,19 @@
# cutoff penalty due to lattice summation
LATTICE_SUM_PENALTY = 1e-1


def unique_with_wrap_around(cell, kpts):
'''Search unique kpts in first Brillouin zone.'''
scaled_kpts = cell.get_scaled_kpts(kpts).round(5)
scaled_kpts = numpy.modf(scaled_kpts)[0]
scaled_kpts[scaled_kpts >= .5] -= 1
scaled_kpts[scaled_kpts < -.5] += 1

uniq_index, uniq_inverse = unique(scaled_kpts)[1:3]
uniq_kpts = kpts[uniq_index]
return uniq_kpts, uniq_index, uniq_inverse


def make_auxmol(mol, auxbasis):
'''Generate a fake Mole object which uses the density fitting auxbasis as
the basis sets. If auxbasis is not specified, the optimized auxiliary fitting
Expand Down
2 changes: 1 addition & 1 deletion python/green_igen/linalg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ def cho_solve(a, b, strict_sym_pos=True):
on matrix a
'''
try:
return scipy.linalg.solve(a, b, sym_pos=True)
return scipy.linalg.solve(a, b, assume_a='pos')
except numpy.linalg.LinAlgError:
if strict_sym_pos:
raise
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ set_target_properties(pbc0 PROPERTIES
COMPILE_FLAGS ${OpenMP_C_FLAGS}
LINK_FLAGS ${OpenMP_C_FLAGS})

target_link_libraries(pbc0 ${BLAS_LIBRARIES})
target_link_libraries(pbc0 PUBLIC ${BLAS_LIBRARIES} m)
if (HAVE_LIBQUADMATH AND HAVE_QUADMATH_H)
target_link_libraries(pbc0 PUBLIC quadmath)
target_compile_definitions(pbc0 PUBLIC USE_LIBQUADMATH)
endif()
Loading