Skip to content

Commit 4b3c4f6

Browse files
Fix #925: inconsistent return in df_integrals.py::double_factorize (#1111)
The `double_factorize` method in the `DFABKpointIntegrals` class had an inconsistent return. It was type-hinted to return `None`, but had a code path that returned a value. This early return also caused a caching issue where the method would incorrectly return a cached result even when called with a new `thresh` value, preventing re-computation. This commit removes the premature return statement. This allows the `thresh` parameter to take effect as intended and makes the method's behavior consistent with its type hint. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent cff68e6 commit 4b3c4f6

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/openfermion/resource_estimates/pbc/df/df_integrals.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def __init__(self, cholesky_factor: npt.NDArray, kmf: scf.HF):
8686
self.reverse_k_transfer_map[kidx, kmq_idx] = qidx
8787

8888
# set up for later when we construct DF
89-
self.df_factors = None
9089
self.a_mats = None
9190
self.b_mats = None
9291

@@ -168,8 +167,6 @@ def double_factorize(self, thresh=None) -> None:
168167
"""
169168
if thresh is None:
170169
thresh = 1.0e-13
171-
if self.df_factors is not None:
172-
return self.df_factors
173170

174171
nkpts = self.nk
175172
nmo = self.nao

0 commit comments

Comments
 (0)