Skip to content

Commit 135d7fe

Browse files
authored
loosen install requirements (#190)
1 parent 13810d6 commit 135d7fe

File tree

7 files changed

+60
-21
lines changed

7 files changed

+60
-21
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
repos:
2-
- repo: https://github.com/facebook/pyrefly-pre-commit
3-
rev: 0.0.1
4-
hooks:
5-
- id: pyrefly-typecheck-system
6-
name: Pyrefly (type checking)
7-
pass_filenames: false # Recomended to do full repo checks. However, you can change this to `true` to only check changed files
82
- repo: https://github.com/pre-commit/pre-commit-hooks
93
rev: v6.0.0
104
hooks:

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [UNRELEASED]
8+
## [0.0.11]
9+
### Fixed
10+
- Bug in `HamiltonianBuilder` in reduction of active space.
911
### Changed
1012
- Where localizers or `NbedDriver` would delete rows from C matrix, these are now replaced with 0 values.
13+
- Reduce `numpy` version requirement to `>=2.0.0`.
1114

1215
## [0.0.10]
1316
Major refactor, with several breaking changes!

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ authors:
88
given-names: Alexis
99
orcid: https://orcid.org/0000-0001-8953-1235
1010
title: "Nbed"
11-
version: 0.0.10
11+
version: 0.0.11
1212
date-released: 2022-03-07
1313
doi: 10.5281/zenodo.6323338

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
author = "Michael Williams de la Bastida, Alexis Ralli"
2929

3030
# The full version, including alpha/beta/rc tags
31-
release = "0.0.10"
31+
release = "0.0.11"
3232

3333

3434
# -- General configuration ---------------------------------------------------

nbed/ham_builder.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,23 @@ def build(
241241
occupied_indices = [*range(0, self.n_frozen_core)]
242242
else:
243243
occupied_indices = []
244-
245-
active_indices = [*range(one_body_integrals.shape[0])]
244+
logger.debug(f"{occupied_indices=}")
245+
active_indices = [*range(one_body_integrals.shape[-1])]
246246
if self.n_frozen_virt != 0:
247247
active_indices = active_indices[: -self.n_frozen_virt]
248+
logger.debug(f"{active_indices=}")
248249

250+
logger.debug(f"{one_body_integrals.shape=}")
251+
logger.debug(f"{two_body_integrals.shape=}")
249252
core_const, one_body_integrals, two_body_integrals = get_active_space_integrals(
250253
one_body_integrals,
251254
two_body_integrals,
252255
occupied_indices=occupied_indices,
253256
active_indices=active_indices,
254257
)
258+
logger.debug(f"{one_body_integrals.shape=}")
259+
logger.debug(f"{two_body_integrals.shape=}")
260+
255261
self.constant_e_shift += core_const
256262

257263
one_body_coefficients, two_body_coefficients = self._spinorb_from_spatial(
@@ -356,8 +362,14 @@ def get_active_space_integrals(
356362
# Restrict integral ranges and change M appropriately
357363
return (
358364
core_constant,
359-
one_body_integrals_new[np.ix_(active_indices, active_indices)],
365+
one_body_integrals_new[np.ix_([0, 1], active_indices, active_indices)],
360366
two_body_integrals[
361-
np.ix_(active_indices, active_indices, active_indices, active_indices)
367+
np.ix_(
368+
[0, 1, 2, 3],
369+
active_indices,
370+
active_indices,
371+
active_indices,
372+
active_indices,
373+
)
362374
],
363375
)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "nbed"
3-
version = "0.0.10"
3+
version = "0.0.11"
44
description = "Projection-based embedding methods for reducing quantum simulation resource requirements."
55
authors = [
66
{ name = "Michael Williams de la Bastida", email = "michael.williams.20@ucl.ac.uk" },
@@ -12,7 +12,7 @@ dependencies = [
1212
"PyYAML (>=6.0.0, <7.0.0)",
1313
"qiskit-nature (>=0.7.0,<1.0.0)",
1414
"pyscf (>=2.3.0, <3.0.0)",
15-
"numpy>=2.3.0",
15+
"numpy>=2.0.0",
1616
"pydantic>=2.11.7",
1717
"pytest-xdist>=3.8.0",
1818
]
@@ -32,6 +32,7 @@ dev = [
3232
"pyrefly>=0.36.1",
3333
"pytest-watcher>=0.4.3",
3434
"nb-clean>=4.0.1",
35+
"ty>=0.0.13",
3536
]
3637
docs = [
3738
"myst-nb>=1.3.0",

0 commit comments

Comments
 (0)