-
Notifications
You must be signed in to change notification settings - Fork 40
Add Linear Nk OCCRI method + ISDF #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kosm6966
wants to merge
47
commits into
pyscf:master
Choose a base branch
from
kosm6966:occri
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
…ks and write kpt functions.
…imized liibraries.
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Is it better to put these codes in pbc/df? |
sunqm
reviewed
Aug 17, 2025
…an exception in Python. Cache FFTW plan.
…ed tests and examples.
I'm happy to move these here. Just let me know your preference. Thanks! |
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.
##Summary
• Add OCCRI method for efficient exact exchange evaluation in periodic systems with significant algorithmic improvements.
• Performance is similar to but typically faster than existing occri method
• Designed to integrate with isdfx
• Provide memory-efficient implementations with MO blocking following PySCF patterns
• Implement ISDFX (Interpolative Separable Density Fitting eXchange) module with comprehensive testing and examples
• Exchange build is linear with N_k as shown by Example 2
• Default threshold is set and provides < 50 μHa error for all test systems
• Include comprehensive test suites and educational examples demonstrating usage and performance
Features
• OCCRI: Exchange matrix evaluation using occupied orbital resolution of identity
• ISDFX: Tensor hypercontraction-based exchange with interpolative separable density fitting
• Support for RHF, UHF, RKS, UKS and k-point variants (KRHF, KUHF, KUKS, KRKS)
• Memory management with automatic MO blocking for large systems
• Comprehensive utility functions separated from object methods for better code organization
• Natural orbital construction and exchange matrix building utilities
Performance & Accuracy
• ISDFX provides near-FFTDF accuracy (typically <50 μHa energy differences)
• Scaling analysis shows sub-quadratic performance with k-point sampling
• Memory-efficient MO blocking prevents memory overflow for large systems
• Proper handling of asymmetric k-point meshes and complex conjugation
Testing & Examples
• 84 comprehensive tests covering energy accuracy, k-point handling, and edge cases
• Energy comparison tests with 50 μHa tolerance vs FFTDF reference
• Asymmetric k-point tests to catch symmetry and conjugation bugs
• Educational examples: basic usage, AFM initial guess setup, scaling analysis
• Integration with existing run_tests.py framework with --perf flag support
Code Quality
• Follows PySCF coding conventions with comprehensive docstrings
• Separation of pure algorithms from object methods for better maintainability
• Formatted with Black, isort, and flake8
• Extensive error handling and input validation
• Memory cleanup following PySCF patterns
Test plan