From fcb0ebca88dc3a99243739d3d7cdb572ca18792d Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Thu, 20 Apr 2023 20:09:33 +0000 Subject: [PATCH 1/3] Update scipy version requirements. v1.10.0 of scipy introduces a bug in the linalg.sqrtm function for complex valued matrices QuarticFermionicSimulationGate. Restrict maximum scipy version until this is resolved. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b42e8265..8122882d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,5 @@ networkx numpy>=1.11.0 pubchempy requests>=2.18 -scipy>=1.1.0 +scipy>=1.1.0,<1.10.0 sympy From 192c19b3584fc6b4a57028d4a5a4a6ea62a87a8c Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Wed, 19 Apr 2023 22:19:26 +0000 Subject: [PATCH 2/3] Change two_body.dtype comparison from numpy.float to numpy.float64. numpy.float was deprecated in v1.24.0. --- .../ops/representations/diagonal_coulomb_hamiltonian.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py b/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py index 3ccad8e8..52de901b 100644 --- a/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py +++ b/src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py @@ -37,9 +37,9 @@ class DiagonalCoulombHamiltonian: """ def __init__(self, one_body, two_body, constant=0.): - if two_body.dtype != numpy.float: + if two_body.dtype != numpy.float64: raise ValueError('Two-body tensor has invalid dtype. Expected {} ' - 'but was {}'.format(numpy.float, two_body.dtype)) + 'but was {}'.format(numpy.float64, two_body.dtype)) if not numpy.allclose(two_body, two_body.T): raise ValueError('Two-body tensor must be symmetric.') if not numpy.allclose(one_body, one_body.T.conj()): From 7ad208afb5fb8d2ddc36c922ec1dd7b7a3874b76 Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Thu, 20 Apr 2023 21:03:06 +0000 Subject: [PATCH 3/3] Update ci to use ubuntu-latest. 18.04 was deprecated in April 2023. See https://github.com/actions/runner-images/issues/6002. --- .github/workflows/ci.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d50b4ed5..0746e8da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,14 @@ on: [pull_request] jobs: format: name: Format check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-python@v1 with: - python-version: '3.6' + python-version: '3.8' architecture: 'x64' - name: Install yapf run: cat dev_tools/conf/pip-list-dev-tools.txt | grep yapf | xargs pip install @@ -18,12 +20,12 @@ jobs: run: check/format-incremental mypy: name: Type check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-python@v1 with: - python-version: '3.6' + python-version: '3.8' architecture: 'x64' - name: Install mypy run: cat dev_tools/conf/pip-list-dev-tools.txt | grep mypy | xargs pip install @@ -31,12 +33,12 @@ jobs: run: check/mypy lint: name: Lint check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-python@v1 with: - python-version: '3.6' + python-version: '3.8' architecture: 'x64' - name: Install pylint run: cat dev_tools/conf/pip-list-dev-tools.txt | grep "pylint\|astroid" | grep -v "#" | xargs pip install @@ -71,9 +73,11 @@ jobs: shell: bash coverage: name: Coverage check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-python@v1 with: python-version: '3.8' @@ -85,4 +89,4 @@ jobs: pip install -r dev_tools/conf/pip-list-dev-tools.txt git config --global user.name ${GITHUB_ACTOR} - name: Coverage check - run: check/pytest-and-incremental-coverage --actually-quiet + run: check/pytest-and-incremental-coverage \ No newline at end of file