Skip to content

Symmetrization M0: add characterization harness, capture multi-band bug#366

Merged
PDoakORNL merged 3 commits into
CompFUSE:masterfrom
tylersax:symm-pr-0
Jun 23, 2026
Merged

Symmetrization M0: add characterization harness, capture multi-band bug#366
PDoakORNL merged 3 commits into
CompFUSE:masterfrom
tylersax:symm-pr-0

Conversation

@tylersax

@tylersax tylersax commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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::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. 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-failure

Expected result

All three binaries PASS, including the three-band case.

The threeband_D4 binary prints per-representation diagnostics that include lines like:

  k_iw: FAIL  max|G0 - sym(G0)| = 0.27...

These FAIL lines are the captured-baseline residuals.

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 tylersax marked this pull request as ready for review June 17, 2026 18:48

@PDoakORNL PDoakORNL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread test/unit/phys/dca_step/symmetrization/CMakeLists.txt Outdated
@tylersax

tylersax commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Good call, this makes a lot more sense as integration. Updated (with local re-test passing).

@PDoakORNL PDoakORNL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM now.

@PDoakORNL PDoakORNL merged commit 9b900b3 into CompFUSE:master Jun 23, 2026
2 checks passed
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.

2 participants