Chore: extract calculations from interface and clean up#198
Open
kzsigmond wants to merge 30 commits into
Open
Conversation
Note: this is in preparation of extracting methods that perform computations
This is used at multiple places.
Note: these follow the same structure as compute overlap
Note: this should already be the case for the ProjectedSchrodingerPyCI class
Note: this will be a comment until we have an interface for the variational energy
…ys to slater integers
Only root and least squares supported for projected objective
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 refactors both the
legacy.pyandpyci.pyFanCI interface modules to streamline the conversion of occupation arrays to Slater determinants. It removes theenergy(aka variational-like) objective code, since the classes are for the projected Schrodinger equation. The PR removes unused imports and redundant code.Refactoring and code simplification:
convert_pyci_occs_to_fanpy_sds, in all relevant methods (compute_overlap,compute_overlap_deriv, andcompute_overlap_double_deriv) in bothlegacy.pyandpyci.py. [1] [2] [3] [4] [5] [6]slatermodule in both files, as its functionality is now encapsulated in the utility function. [1] [2]cma,minimize, and related optimization methods. Note that these methods do not work with the Projected Schrodinger objective. They will be added to the variational interface class. The supported optimization modes are'root'and'lstsq'for theProjectedSchrodingerFanCIclass. [1] [2] [3]API and logic changes:
compute_objectiveandcompute_jacobianmethods inlegacy.pyby removing the code paths for the'energy'objective type, focusing exclusively on the'projected'objective. [1] [2] [3]compute_overlap_double_derivto clarify the logic for string and array inputs. [1] [2]Documentation and comments:
pyci.pyas the Projected Schrodinger objective class for PyCI.