LCCD correction Rodrigo - #218
Open
rodrigoaramendes wants to merge 2 commits into
Open
Conversation
…ms, include test_biorthogonality
…els for a fixed spatial 'i'
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.
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).