-
Notifications
You must be signed in to change notification settings - Fork 24
fix: Ensure proper tensor conversion for numpy solver in Eigenvalues … #287
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe NumPy branch of the energy calculation now computes a CPU NumPy transformed Hamiltonian using the lower-triangular factor of the overlap matrix, obtains eigenvalues from that transformed Hamiltonian in NumPy, and returns eigenvalues as a PyTorch tensor with the Hamiltonian's original dtype and device. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
dptb/nn/energy.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
dptb/nn/energy.py (1)
dptb/utils/torch_geometric/data.py (2)
cpu(326-330)to(316-324)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: CodeQL analysis (python)
- GitHub Check: build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
fallback for h_transformed_np when overlap is False
This pull request updates the
forwardmethod indptb/nn/energy.pyto improve compatibility and correctness when using the numpy eigenvalue solver, especially when working with tensors on different devices and data types. The main changes ensure that all tensors are moved to the CPU before being converted to numpy arrays and that the output eigenvalues preserve the original data type. For #275.Key changes:
Device and dtype handling improvements:
Code clarity and correctness:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.