Skip to content

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
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Conversation

kosm6966
Copy link

@kosm6966 kosm6966 commented Aug 1, 2025

##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

  • All 84 tests pass including energy accuracy and performance tests
  • Examples demonstrate proper usage, AFM setup, and scaling behavior
  • Code quality checks pass (Black, isort, flake8)
  • Memory management validated with MO blocking implementation
  • K-point handling thoroughly tested with asymmetric meshes

kosm6966 added 27 commits July 18, 2025 12:28
@kosm6966 kosm6966 changed the title Add OCCRI (Occupied Orbital Coulomb Resolution of Identity) method Add Linear Nk OCCRI method + ISDF Aug 15, 2025
@jeanwsr
Copy link
Contributor

jeanwsr commented Aug 17, 2025

Is it better to put these codes in pbc/df?

@kosm6966
Copy link
Author

Is it better to put these codes in pbc/df?

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants