Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
repos:
- repo: https://github.com/facebook/pyrefly-pre-commit
rev: 0.0.1
hooks:
- id: pyrefly-typecheck-system
name: Pyrefly (type checking)
pass_filenames: false # Recomended to do full repo checks. However, you can change this to `true` to only check changed files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

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

## [0.0.10]
Major refactor, with several breaking changes!
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ authors:
given-names: Alexis
orcid: https://orcid.org/0000-0001-8953-1235
title: "Nbed"
version: 0.0.10
version: 0.0.11
date-released: 2022-03-07
doi: 10.5281/zenodo.6323338
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
author = "Michael Williams de la Bastida, Alexis Ralli"

# The full version, including alpha/beta/rc tags
release = "0.0.10"
release = "0.0.11"


# -- General configuration ---------------------------------------------------
Expand Down
20 changes: 16 additions & 4 deletions nbed/ham_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,23 @@ def build(
occupied_indices = [*range(0, self.n_frozen_core)]
else:
occupied_indices = []

active_indices = [*range(one_body_integrals.shape[0])]
logger.debug(f"{occupied_indices=}")
active_indices = [*range(one_body_integrals.shape[-1])]
if self.n_frozen_virt != 0:
active_indices = active_indices[: -self.n_frozen_virt]
logger.debug(f"{active_indices=}")

logger.debug(f"{one_body_integrals.shape=}")
logger.debug(f"{two_body_integrals.shape=}")
core_const, one_body_integrals, two_body_integrals = get_active_space_integrals(
one_body_integrals,
two_body_integrals,
occupied_indices=occupied_indices,
active_indices=active_indices,
)
logger.debug(f"{one_body_integrals.shape=}")
logger.debug(f"{two_body_integrals.shape=}")

self.constant_e_shift += core_const

one_body_coefficients, two_body_coefficients = self._spinorb_from_spatial(
Expand Down Expand Up @@ -356,8 +362,14 @@ def get_active_space_integrals(
# Restrict integral ranges and change M appropriately
return (
core_constant,
one_body_integrals_new[np.ix_(active_indices, active_indices)],
one_body_integrals_new[np.ix_([0, 1], active_indices, active_indices)],
two_body_integrals[
np.ix_(active_indices, active_indices, active_indices, active_indices)
np.ix_(
[0, 1, 2, 3],
active_indices,
active_indices,
active_indices,
active_indices,
)
],
)
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nbed"
version = "0.0.10"
version = "0.0.11"
description = "Projection-based embedding methods for reducing quantum simulation resource requirements."
authors = [
{ name = "Michael Williams de la Bastida", email = "michael.williams.20@ucl.ac.uk" },
Expand All @@ -12,7 +12,7 @@ dependencies = [
"PyYAML (>=6.0.0, <7.0.0)",
"qiskit-nature (>=0.7.0,<1.0.0)",
"pyscf (>=2.3.0, <3.0.0)",
"numpy>=2.3.0",
"numpy>=2.0.0",
"pydantic>=2.11.7",
"pytest-xdist>=3.8.0",
]
Expand All @@ -32,6 +32,7 @@ dev = [
"pyrefly>=0.36.1",
"pytest-watcher>=0.4.3",
"nb-clean>=4.0.1",
"ty>=0.0.13",
]
docs = [
"myst-nb>=1.3.0",
Expand Down
Loading
Loading