Refactor RGF logic and update parameter types for PyTorch compatibility#26
Merged
Merged
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.
This pull request enhances the flexibility and efficiency of the Green's function calculations in the NEGF (Non-Equilibrium Green's Function) code by introducing new options to control which components of the Green's function are computed. The changes allow users to selectively compute the lesser, greater, and last-column blocks of the retarded Green's function, which can reduce memory usage and computational cost when certain outputs are not needed. Additionally, the documentation is improved for clarity and accuracy.
Key changes include:
Green's function calculation flexibility:
need_lesser,need_greater,need_gr_lc) to thecal_green_functionmethod indevice_property.pyand to the core recursive Green's function routines inrecursive_green_cal.py, allowing users to specify which components (lesser, greater, last-column retarded) to compute. This enables memory and computational savings by only calculating required quantities. [1] [2] [3] [4] [5] [6]Conditional computation and memory optimization:
s_in,s_out) and the computation of the corresponding Green's functions are now conditional, only performed if the relevant flags (need_lesser,need_greater) are set. The last-column blocks (gr_lc) are also only stored ifneed_gr_lcisTrue. [1] [2] [3] [4] [5] [6] [7] [8]Documentation improvements:
device_property.pyandrecursive_green_cal.pyto accurately describe new parameters and return values, and to fix references to the correct documentation locations. [1] [2] [3]Minor code and documentation cleanup:
These changes collectively make the NEGF code more modular, efficient, and user-friendly, especially for large-scale or memory-constrained calculations.