From 3ef5d9dd682f3bc570d659b18554acb021128153 Mon Sep 17 00:00:00 2001 From: Huanchen Zhai Date: Tue, 27 Jun 2023 22:41:29 -0700 Subject: [PATCH] fix clang compile; fix new scipy error --- .github/workflows/build.yml | 4 ++-- src/ic/wick.hpp | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2670ad4..bcae2985 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,14 +119,14 @@ jobs: - name: run test (serial-pytest, linux) if: matrix.parallel == 'serial-pytest' && matrix.os == 'ubuntu-20.04' run: | - python -m pip install pytest 'pyscf==2.1.0' + python -m pip install pytest 'pyscf==2.1.0' 'scipy==1.10.1' export PYTHONPATH=$(pwd)/build:$(pwd):${PYTHONPATH} py.test -s pyblock2/unit_test/*.py - name: run test (serial-pytest, macos) if: matrix.parallel == 'serial-pytest' && matrix.os == 'macos-11' run: | - python -m pip install pytest 'pyscf==2.0.1' + python -m pip install pytest 'pyscf==2.0.1' 'scipy==1.10.1' export PYTHONPATH=$(pwd)/build:$(pwd):${PYTHONPATH} py.test -s pyblock2/unit_test/*.py diff --git a/src/ic/wick.hpp b/src/ic/wick.hpp index 2a8f54e9..4122cd5c 100644 --- a/src/ic/wick.hpp +++ b/src/ic/wick.hpp @@ -1524,7 +1524,7 @@ struct WickExpr { int n_br = 0; for (auto &wi : x.indices) n_br += !gstr.count(wi); - if (has_br = (n_br > 0)) + if ((has_br = (n_br > 0))) break; } for (auto &term : terms) { @@ -3423,6 +3423,7 @@ struct WickGraph { if (uroots[i] == 0) tt.push_back(i); size_t tx = 0; + array empty = {}; auto fw = [&tscale, &uout, &inv_edges, &edges, &uroots, &mscale](int a) -> array { double rs = 0.0, rd = 0.0, rp = 0.0, rg = 0.0; @@ -3493,7 +3494,7 @@ struct WickGraph { int nsz = 0; for (auto &wt : term.tensors) nsz += wt.indices.size() != 0; - if (need_einsum = nsz > 2) + if ((need_einsum = nsz > 2)) break; if (term.ctr_indices.size() == 0) continue; @@ -3502,14 +3503,14 @@ struct WickGraph { for (auto &wi : wt.indices) idx_cnt[wi]++; for (auto &wi : idx_cnt) - if (need_einsum = (wi.second > 2 || - (wi.second == 2 && - !term.ctr_indices.count(wi.first)))) + if ((need_einsum = (wi.second > 2 || + (wi.second == 2 && + !term.ctr_indices.count(wi.first))))) break; if (need_einsum) break; for (auto &wi : left_idx) - if (need_einsum = (idx_cnt.count(wi) != 1)) + if ((need_einsum = (idx_cnt.count(wi) != 1))) break; if (need_einsum) break;