Repository navigation
Commit 1f1b65f
lno: compatibility with pyscf >= 2.14 (dfccsd._contract_vvvv_t2 signature) and NumPy 2 (_cp) (#212)
* lno: compatibility with pyscf >= 2.14 and NumPy 2 in lnoccsd
- DFLNOCCSD._contract_vvvv_t2: pyscf 2.14 changed dfccsd._contract_vvvv_t2 to a
seven-argument signature (mycc, mol, vvL, VVL, t2, out, verbose). The old
six-argument call shifted the arguments, so t2 arrived as out and every
DF-LNO-CCSD run crashed. The call now adapts to the installed signature.
- _cp: np.array(a, copy=False, ...) raises under NumPy 2 when a copy is
unavoidable, which it is for an h5py slice on the out-of-core path
(max_memory below the fragment's Lov block). np.asarray keeps the intended
behaviour on both NumPy 1 and 2.
Both fixes have been running in production LNO-CCSD(T) calculations on benzene
and naphthalene (cc-pVDZ/cc-pVTZ, pyscf 2.14.0, NumPy 2) since 2026-09-10.
* lno: call dfccsd._contract_vvvv_t2 with its real signature, keep _cp NumPy-2 safe, add a regression test for the DF-CCSD fragment solver
Both fixes sit in the DF-CCSD fragment solver (MODIFIED_DFCCSD / _make_df_eris / _DFChemistsERIs), which lnoccsd.CCSD selects only when a
fragment's vvvv block does not fit in 70 % of the available memory; the shipped water-dimer tests never reach it. Review of 24/25 Sep:
- pyscf's dfccsd._contract_vvvv_t2 has had the VVL argument since at least v2.10, so the six-argument call was wrong for every supported
version; call it with (mycc, mol, vvL, VVL, t2, out, verbose) unconditionally, no signature inspection, VVL = vvL as in pyscf's own
_ChemistsERIs.
- _cp: np.asarray(a, order='C') (NumPy 2 raises on copy=False for the non-contiguous Lov slices of the blocked loops).
- test_dfccsd_solver_blocked_df_eris: MODIFIED_DFCCSD on the test's water dimer with max_memory = 1 (forces the blocked loops); fails on
master with ValueError in _cp, with _cp alone fixed with AttributeError in dfccsd._contract_vvvv_t2, passes with both; e_corr equals
cc.CCSD on the same DF mean field to 1e-7.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent 5db5aae commit 1f1b65f
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
400 | 403 | | |
401 | 404 | | |
402 | 405 | | |
| |||
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
470 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
471 | 476 | | |
472 | 477 | | |
473 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
| |||
0 commit comments