Repository navigation
New corrections - #223
Open
rodrigoaramendes wants to merge 10 commits into
Open
New corrections#223rodrigoaramendes wants to merge 10 commits into
rodrigoaramendes wants to merge 10 commits into
Conversation
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.
PCCD/AP1roG wavefunction with memoized seniority filtering and per-parameter-vector overlap caching.
The assignment methods (
assign_nelec,assign_ranks,assign_exops,assign_refwfn,assign_s_type) are carried over unchanged from the reference PCCD implementation; only the overlap routines differ.Differences from the "old" PCCD implementation
The three near-identical seniority-filter blocks are factored into a single
_apply_seniority_filterhelper. Pure deduplication; no change in results.The filter is memoized. It is idempotent (rerunning it on an already-filtered array reselects the same rows) and upstream mutates
exop_combinations[key]in place, so re-deriving the selection on every call is wasted work. Two separate key sets are kept because_olpfilters againstocc_indices(sd2)(the reference) while_olp_derivfilters againstocc_indices(sd)(the target).generate_possible_exopsis overridden so that ifBaseCC'srefresh_exopsmechanism discardsexop_combinations, the filter caches are dropped with it. Without that, a regenerated (unfiltered) key would be treated as already filtered._olp(sd)/_olp_deriv(sd)are memoized per parameter vector. For fixed amplitudes these are pure functions ofsd, and the samesdrecurs many times within one objective or gradient evaluation (once as a projection-space element, again as an excitation neighbour of other elements insideintegrate_sd_wfn). The caches are cleared fromassign_params,assign_refwfnandclear_cache, so a cached value is only reused while the parameters that produced it are current.legacy_deriv_filtercontrols a genuine behavioural divergence. The reference_olp_derivand_olp_double_derivativeapply the "sen-o" filter unconditionally, ignorings_type(only_olpdispatches on it). Withlegacy_deriv_filter = True(the default here), that behaviour is reproduced exactly. WithFalse, the derivative honourss_type, which makes the gradient the actual derivative of the value this object returns, relevant only fors_type != "sen-o", since the two agree on the default.