Skip to content

[mesh] Make the dlr_imtime mesh hash blind to the particle statistic - #1025

Open
Wentzell wants to merge 1 commit into
unstablefrom
statistic_blind_imtime_hash
Open

[mesh] Make the dlr_imtime mesh hash blind to the particle statistic#1025
Wentzell wants to merge 1 commit into
unstablefrom
statistic_blind_imtime_hash

Conversation

@Wentzell

Copy link
Copy Markdown
Member

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. Plain imtime already permits this since its hash never sees the statistic, but dlr_imtime hashed 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 ifnodes fingerprint 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 both imtime and dlr_imtime. The frequency meshes (imfreq, dlr_imfreq) keep their statistic-dependent hashes, as required.

  • Requires cppdlr 1.4 for 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#21
  • 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 the new itnodes_idx dataset and the odd symmetrized DLR ranks from the cppdlr self-symmetric fixed-point change; all previously pinned quantities are bit-identical

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

1 participant