From 7316afa72139014dadd36c0939ce774a8e2e6e7c Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 17:45:17 +0100 Subject: [PATCH 1/6] Fix CI->C for open shell UHF --- ebcc/ext/fci.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebcc/ext/fci.py b/ebcc/ext/fci.py index 03194c39..4809118d 100644 --- a/ebcc/ext/fci.py +++ b/ebcc/ext/fci.py @@ -401,9 +401,9 @@ def _get_c(spins: str) -> NDArray[T]: # Decompress the axes shape = tuple( space["ab".index(s)].size(char) - for char, s in zip("O" * nalph + "V" * nalph + "O" * nbeta + "V" * nbeta, spins + spins) + for char, s in zip("O" * nalph + "O" * nbeta + "V" * nalph + "V" * nbeta, spins + spins) ) - subscript = "i" * nalph + "a" * nalph + "j" * nbeta + "b" * nbeta + subscript = "i" * nalph + "j" * nbeta + "a" * nalph + "b" * nbeta cn = util.decompress_axes(subscript, cn, shape=shape) # Transpose the axes From aaa2e0ed7cdefe02811fa109e35a5dc94b2e76df Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 17:46:41 +0100 Subject: [PATCH 2/6] upgrade checkout --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/publish.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7044a440..63a8f14d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/cache@v2 with: key: ${{ github.ref }} @@ -52,7 +52,7 @@ jobs: - {python-version: "3.12", backend: "jax", os: ubuntu-latest, coverage: False, minimal: True, full: False} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/cache@v2 with: key: ${{ github.ref }} @@ -97,7 +97,7 @@ jobs: if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/cache@v2 with: key: ${{ github.ref }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e298f296..e7e9fa30 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,7 +17,7 @@ jobs: id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up python "3.9" uses: actions/setup-python@v2 with: From 04ceb35be4483f3b5dce0cdc034abccb07da24f0 Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 17:49:14 +0100 Subject: [PATCH 3/6] Upgrade more actions --- .github/workflows/ci.yaml | 12 ++++++------ .github/workflows/publish.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 63a8f14d..a3ada1aa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,12 +13,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.10" - name: Upgrade pip @@ -53,12 +53,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Upgrade pip @@ -98,12 +98,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: key: ${{ github.ref }} path: .cache - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.10" - name: Upgrade pip diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e7e9fa30..2d8f33e2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up python "3.9" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.9" - name: Upgrade pip From d30c9caf807abfcedc5f43731618d16dde0c436c Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 17:53:45 +0100 Subject: [PATCH 4/6] Ignore mypy error --- ebcc/util/einsumfunc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebcc/util/einsumfunc.py b/ebcc/util/einsumfunc.py index 6c71f205..352cfd1e 100644 --- a/ebcc/util/einsumfunc.py +++ b/ebcc/util/einsumfunc.py @@ -511,7 +511,7 @@ def einsum( # If it's a chain of contractions, use the path optimizer args = list(args) path_kwargs = dict(optimize=optimize, einsum_call=True) - contractions = np.einsum_path(subscript, *args, **path_kwargs)[1] + contractions = np.einsum_path(subscript, *args, **path_kwargs)[1] # type: ignore[arg-type] for contraction in contractions: inds, idx_rm, einsum_str, remain = list(contraction[:4]) contraction_args = [args.pop(x) for x in inds] # type: ignore From 42489fd4972d773fb9fdeb40575c05d9dc40e56b Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 18:11:01 +0100 Subject: [PATCH 5/6] fix conversion --- ebcc/ext/fci.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ebcc/ext/fci.py b/ebcc/ext/fci.py index 4809118d..62437c58 100644 --- a/ebcc/ext/fci.py +++ b/ebcc/ext/fci.py @@ -399,11 +399,13 @@ def _get_c(spins: str) -> NDArray[T]: cn = ci[addrsi, addrsj] * signsi * signsj # Decompress the axes + spins_full = spins + spins + spins_full = spins_full[::2] + spins_full[1::2] shape = tuple( space["ab".index(s)].size(char) - for char, s in zip("O" * nalph + "O" * nbeta + "V" * nalph + "V" * nbeta, spins + spins) + for char, s in zip("O" * nalph + "V" * nalph + "O" * nbeta + "V" * nbeta, spins_full) ) - subscript = "i" * nalph + "j" * nbeta + "a" * nalph + "b" * nbeta + subscript = "i" * nalph + "a" * nalph + "j" * nbeta + "b" * nbeta cn = util.decompress_axes(subscript, cn, shape=shape) # Transpose the axes From e9eefc5e2954a6c2571542b146bbe33901eb6a8c Mon Sep 17 00:00:00 2001 From: Oliver Backhouse Date: Thu, 16 Apr 2026 18:16:25 +0100 Subject: [PATCH 6/6] Drop 3.9 --- .github/workflows/ci.yaml | 1 - .github/workflows/publish.yaml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3ada1aa..04a6cf56 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,7 +44,6 @@ jobs: fail-fast: false matrix: include: - - {python-version: "3.9", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True} - {python-version: "3.10", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True} - {python-version: "3.11", backend: "numpy", os: ubuntu-latest, coverage: True, minimal: True, full: True} - {python-version: "3.12", backend: "numpy", os: ubuntu-latest, coverage: False, minimal: True, full: True} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2d8f33e2..f8a5e3cc 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up python "3.9" + - name: Set up python "3.10" uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.10" - name: Upgrade pip run: | python -m pip install --upgrade pip