Skip to content

LCCD correction Rodrigo - #218

Open
rodrigoaramendes wants to merge 2 commits into
lccd-correctionfrom
lccd-correction-rodrigo
Open

LCCD correction Rodrigo#218
rodrigoaramendes wants to merge 2 commits into
lccd-correctionfrom
lccd-correction-rodrigo

Conversation

@rodrigoaramendes

@rodrigoaramendes rodrigoaramendes commented Jul 31, 2026

Copy link
Copy Markdown

This Pull request introduces fixes applied relative to the original "first implementation":

  • A_mu_nu accumulator was being reset inside the 'for m in pspace' loop,
    so only the last pspace determinant ever contributed. Fixed by
    accumulating over m before applying the diagonal correction.

  • Parameters were enumerated over ALL ordered (i,j,a,b), even though
    tau_(i,j,a,b) == tau_(j,i,b,a) (E_ai and E_bj commute). See the conditions
    set in the paper. This produced exact duplicate rows/columns in A -> singular
    matrix -> needed lstsq.
    Fixed by enumerating only unique, unordered occ-virt pairs (P<Q).

  • The excluded pair-excitation case (i=j, a=b, t_ii^aa=0) was still
    being created as a parameter with an all-zero row/column (since
    _generate_sub_exops strips all its sub-excitations). This is now
    automatically excluded by the P<Q parameterization.

  • Solve with np.linalg.solve instead of scipy.linalg.lstsq now that A
    should be square and (generically) non-singular.

  • Energy formula: corrected to properly sum both index orderings of each unique amplitude (see note in compute_correction).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant