Symmetrization M0: add characterization harness, capture multi-band bug#366
Merged
Conversation
Add a per-(model, point-group) characterization harness for single-particle cluster symmetrization, generalizing the existing identity-only symmetrize_test onto real point groups. It is the regression net for upcoming Hamiltonian- derived symmetrization work. Oracle: G0 = [iw + mu - H0]^-1 is deterministic and exactly invariant under every symmetry of H0, so symmetrizing G0 must be a no-op (asserted to 1e-12). Note: this harness flagged a failure the first time it ran, and we are capturing that failure on purpose. Production Symmetrize::execute is not a no-op on the three-band Hubbard model with D4 symmetry. Given the exact, deterministic oracle, the failure is treated as an existing defect in the imposition. Rather than commit a red test, the observed failures are encoded as the expected result. This keeps CI green and makes the test fixture both the record of the bug and the gate for its fix: when the imposition is corrected the assertion flips (forcing the test to be cleaned up). Structure: four tests per case, one binary per case selected via CMake TEST_DEFINES. square/D4 and singleband-chain are clean green baselines; three-band/D4 carries the pinned failure above.
tylersax
commented
Jun 17, 2026
tylersax
commented
Jun 17, 2026
PDoakORNL
requested changes
Jun 18, 2026
PDoakORNL
left a comment
Contributor
There was a problem hiding this comment.
I think this is actually a nice example of an integration test so I'd move it to test/integration/phys/symmetrization
Which will be a new category of integration test for us.
So the only thing I see right now is move this.
Generally I'd say for unit tests you need a class or function(in which case I'd treat the filename as the class for purposes of naming the test) that you are trying to test as standalone as possible (within reason).
Contributor
Author
|
Good call, this makes a lot more sense as integration. Updated (with local re-test passing). |
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.
Add a per-(model, point-group) characterization harness for single-particle cluster symmetrization, generalizing the existing identity-only symmetrize_test onto real point groups. It is the regression net for upcoming Hamiltonian- derived symmetrization work.
Oracle: G0 = [iw + mu - H0]^-1 is deterministic and exactly invariant under every symmetry of H0, so symmetrizing G0 must be a no-op (asserted to 1e-12).
Note: this harness flagged a failure, and it captures that failure on purpose. Production
Symmetrize::executeis not a no-op on the three-band Hubbard model with D4 symmetry. Given the exact, deterministic oracle, the failure is treated as an existing defect in the imposition. Rather than commit a red test, the observed failures are encoded as the expected result. So, read this test fixture as both the record of the bug and the gate for its fix: when the imposition is corrected, the assertion flips (forcing the test to be cleaned up).Structure: Four tests per case, one binary per case selected via CMake TEST_DEFINES.
Building & running
cmake -S . -B build -DDCA_WITH_TESTS_FAST=ON cmake --build build -j --target \ symmetrize_characterization_square_D4_test \ symmetrize_characterization_threeband_D4_test \ symmetrize_characterization_singleband_chain_test ctest --test-dir build -R symmetrize_characterization --output-on-failureExpected result
All three binaries PASS, including the three-band case.
The
threeband_D4binary prints per-representation diagnostics that include lines like:These
FAILlines are the captured-baseline residuals.