[mesh] Make the dlr_imtime mesh hash blind to the particle statistic - #1025
Open
Wentzell wants to merge 1 commit into
Open
[mesh] Make the dlr_imtime mesh hash blind to the particle statistic#1025Wentzell wants to merge 1 commit into
Wentzell wants to merge 1 commit into
Conversation
The mesh hash is the cheap compatibility guard for indexing a gf with a mesh point. The imaginary time node layout does not depend on the statistic, so mixing statistics is legitimate and already used in practice: the particle-hole bubble in gf_bubble_time writes into a bosonic chi while iterating the fermionic mesh of g. imtime already permits this, since its inherited hash(N, a, b) never sees the statistic, but dlr_imtime hashed the statistic both explicitly and through the imaginary frequency nodes, which really do differ between statistics. The equivalent DLR bubble therefore aborted in a debug build. Hash the imaginary time node indices instead, the quantity that actually defines this mesh's layout. They are integers, so meshes that should compare equal always do, including across toolchains and h5 round-trips, which was the property the ifnodes fingerprint was chosen for in 7e34182. operator== keeps comparing the statistic, so whole-object operations still raise. That split is now the intended contract: hash = layout compatibility, == = full mesh identity. Documented on both imtime and dlr_imtime. imfreq, dlr_imfreq, dlr, legendre and chebyshev keep their statistic-dependent hashes; for the two frequency meshes this is required. - Require cppdlr 1.4 for imtime_ops::get_itnodes_idx - Add pp-bubble tests for imtime and dlr_imtime driven from the bosonic mesh, mesh-level hash/equality assertions, and a Python mirror - Pin the imaginary time node indices in mesh_dlr_stability, a sharper guard against cppdlr grid drift than floats compared at 1e-14 Regenerate mesh_dlr_stability.ref.h5 for two reasons: the new itnodes_idx dataset, and the symmetrized DLR ranks turning odd with the cppdlr self-symmetric fixed point change. All previously pinned quantities are bit-identical to the values that change produced. Assisted-by: Claude <noreply@anthropic.com>
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.
The mesh hash is the cheap compatibility guard for indexing a gf with a mesh point. The DLR imaginary-time node layout does not depend on the statistic, so mixing statistics is legitimate and already used in practice, e.g. accumulating a bosonic susceptibility while iterating the fermionic mesh of
g. Plainimtimealready permits this since its hash never sees the statistic, butdlr_imtimehashed it both explicitly and through the imaginary-frequency nodes, so the equivalent DLR bubble aborted in a debug build.This PR hashes the imaginary-time node fine-grid indices instead — the quantity that actually defines the layout. Being integers, they are stable across toolchains and h5 round-trips (the property the
ifnodesfingerprint was chosen for in 7e34182).operator==keeps comparing the statistic, so whole-mesh operations still raise: hash = layout compatibility,=== full mesh identity. This contract is now documented on bothimtimeanddlr_imtime. The frequency meshes (imfreq,dlr_imfreq) keep their statistic-dependent hashes, as required.imtime_ops::get_itnodes_idx, added in the matching PR Store and expose the DLR node fine grid indices and the symmetrize flag flatironinstitute/cppdlr#21imtimeanddlr_imtimedriven from the bosonic mesh, mesh-level hash/equality assertions, and a Python mirrormesh_dlr_stability, a sharper guard against cppdlr grid drift than floats compared at 1e-14mesh_dlr_stability.ref.h5for the newitnodes_idxdataset and the odd symmetrized DLR ranks from the cppdlr self-symmetric fixed-point change; all previously pinned quantities are bit-identical