Repository navigation
propSAPT's own CPSCF solver; Psi4 supplies only the orbital-Hessian products - #6
Merged
Merged
Conversation
… equations `prop_sapt.cpscf_solver.conjugate_gradient` solves H x = b for several right-hand sides, taking the products of all unconverged vectors in one call, each vector converging on its own. It starts from b / diagonal and stops at a relative residual below `r_convergence`, as Psi4's `p4util.cg_solver` does, and warns when a vector has not converged or meets a direction of non-positive curvature. Unit tests on small dense systems, no SCF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-Hessian products `cpscf_batch` solves H t = -omega with `conjugate_gradient`, where H is the positive definite orbital Hessian of the new `orbital_hessian_product`. That wraps `cphf_Hx`, which returns -H, and swaps in the CPSCF J/K object for each product. `p4util.cg_solver` and `Matrix.apply_denominator` are no longer used. The amplitudes agree with the old solver to 4e-13 for He-H2 (RHF and PBE0, SCF and DF J/K), with the same iterations. Tests: the amplitudes solve their equations, the Hessian is symmetric and positive, and the J/K restore after a failure now fails the Hessian product instead of the solver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
btyrcha
force-pushed
the
feature/cpscf-solver
branch
from
November 19, 2026 11:20
abdae0b to
a63a0a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
prop_sapt/cpscf_solver.py: a batched, preconditioned conjugate-gradient solver. It replaces Psi4's internalp4util.cg_solverandMatrix.apply_denominator, which propSAPT no longer uses. Like before, it starts from the uncoupled amplitudes, each vector converges on its own relative residual, and each iteration applies the Hessian to all unconverged vectors in one call.orbital_hessian_product(monomer, vectors)on the dimer: the positive definite orbital Hessian, from Psi4'scphf_Hx(which returns its negative), with thecpscf_typeJ/K object swapped in for each product.cpscf_batchsolves H t = -omega, so the amplitudes keep their convention.cpscf_maxiteriterations now raises aRuntimeWarningand writes a line to the output file, where it used to go on silently. The CPSCF log in the output file has a new format.Tested: unit tests of the solver on small dense systems (no SCF); new He–H2 tests that the amplitudes solve their equations and that the Hessian product is symmetric and positive; the
cpscf_typefailure test now fails the Hessian product. The full suite passes locally (477 passed, 2 skipped, 2 xfailed). In one process on He–H2 (RHF and PBE0, SCF and DF J/K), the amplitudes agree with the old solver to 4e-13, with the same Hessian-product calls.🤖 Generated with Claude Code