Closed
Conversation
added 9 commits
February 15, 2026 02:33
14 tasks
Contributor
|
Superseeded by #236 |
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.
Week-5: Add tests, benchmarks, and real-basis validation for density API
This PR completes the Week-5 milestone of the density (intracule and extracule) API by adding comprehensive tests and performance validation.
Summary of additions
This PR introduces five new test modules to validate correctness, robustness, and performance of the
compute_intraculeandcompute_extraculeAPIs implemented in Week-4.Test coverage details
1. Unit tests for intracule (
tests/test_intracule.py)These tests verify the basic correctness and expected behavior of
compute_intracule.They validate:
Shape correctness
Ensures the returned matrix has shape
(n, n)wherenis the number of shells.Empty input handling
Confirms the function correctly returns an empty
(0, 0)matrix when given no shells.Symmetry property
The intracule and extracule matrices are expected to be symmetric because they are based on overlap integrals between pairs
of shells.
This means the interaction between shell i and shell j must be the same as the interaction between shell j and shell i.
The test verifies this by checking that the matrix is equal to its transpose:
result[i, j] == result[j, i]
This confirms the matrix is constructed correctly and consistently.
2. Unit tests for extracule (
tests/test_extracule.py)These tests perform the same structural and correctness validation for
compute_extracule, ensuring:This confirms both density APIs behave consistently.
3. Performance benchmark (
tests/test_performance.py)This test evaluates execution time of the intracule computation on a moderate number of shells.
It verifies that:
This ensures the implementation remains efficient and suitable for practical use.
4. Real basis validation for intracule (
tests/test_intracule_real.py)This test validates the intracule implementation using an actual Gaussian basis set (
data_631g.gbs) included in the repository.The test:
GeneralizedContractionShellobjectsIt then verifies:
This confirms the API works correctly with real scientific input.
5. Real basis validation for extracule (
tests/test_extracule_real.py)This performs the same real-data validation for
compute_extracule, ensuring:Overall validation achieved
These tests collectively verify:
All existing and new tests pass successfully.
This PR builds directly on the Week-4 density API implementation.