Skip to content

Feature/direct grid chi0#370

Draft
PDoakORNL wants to merge 7 commits into
CompFUSE:masterfrom
PDoakORNL:feature/direct-grid-chi0
Draft

Feature/direct grid chi0#370
PDoakORNL wants to merge 7 commits into
CompFUSE:masterfrom
PDoakORNL:feature/direct-grid-chi0

Conversation

@PDoakORNL

Copy link
Copy Markdown
Contributor

This returns the C++ main_analysis code to a working state.

PDoakORNL added 7 commits May 29, 2026 17:33
The analysis application now writes leading-eigenvalues as a dataset
directly under /analysis-functions/ (compound type with 'r'/'i' fields),
rather than as a group containing a 'data' sub-dataset.

Update the script to read the dataset directly and extract the real part
via the named 'r' field instead of positional indexing.
h5py automatically converts HDF5 compound types with 'r'/'i' fields
into numpy complex128 arrays. The script was trying string-index field
access (['r']) which fails on complex scalars. Use .real instead.
Fixes applied:
- basis_transform.hpp: add is_initialized() to func::dmn_0 specialization,
  enabling per-patch interpolation matrix recomputation
- interpolation_matrices.hpp: invalidate trafo cache each patch iteration
- bse_cluster_solver.hpp: apply beta*Nc scaling to Gamma_cluster;
  load G_II_0 before symmetrization
- bse_lattice_solver.hpp: remove spurious 1/(beta*N_host) renorm factor;
  skip PP_UP_DOWN symmetrization
- dca_data.hpp: read chemical potential from DCA-loop-functions HDF5 group
- analyzeDCA_multiOrbit.py: fix typos, add __main__ block
Implements a direct uniform-grid chi0 lattice calculation in BseLatticeSolver
that matches Python's buildFullChi0Lattice to machine precision.

Changes:
- Add analysis parameters direct-grid-chi0 and direct-grid-nkfine
- Add evaluateH0AtK() pointwise H0 interface to all lattice models
- Implement computeChi0DirectGrid() in BseLatticeSolver:
  * per-patch grid generation using cluster basis vectors
  * Voronoi-cell shift matching Python's build_kGrid(cluster=True)
  * correct use of fixed four-point momentum transfer Q in the bubble
  * correct PP channel momentum combination Q-k
- Update unit tests for new parameters and square_lattice evaluateH0AtK

Verified on T=0.07, 0.08, 0.09, 0.10: C++ and Python chi0 lattice
agree to relative error ~5e-15 (machine precision).
For PARTICLE_PARTICLE_UP_DOWN with Q=0 and direct-grid-chi0=true,
route diagonalization through diagonalizeGammaChi0Full() instead of
diagonalizeGammaChi0Symmetric(). The symmetric method took the real
part of sqrt(chi0)*Gamma*sqrt(chi0) before diagonalizing, which
shifted eigenvalues by 1.5-7.6% relative to Python's full complex
kernel Gamma*chi0/(beta*Nc).

Also apply the 1/(beta*Nc) scaling in the full diagonalization path
so the C++ kernel matches Python's exactly.

Verified on T=0.07, 0.08, 0.09, 0.10: C++ leading eigenvalues now
agree with Python to machine precision (max relative diff ~5e-14).
Update the Tc tutorial input template and regenerate preconfigured
inputs to use the new direct-grid chi0 lattice calculation. Add
documentation for the direct-grid-chi0 and direct-grid-nkfine analysis
parameters.

- tutorials/tc/input_tp.json.in: add direct-grid-chi0: true and
  direct-grid-nkfine: 32 to analysis section
- tutorials/tc/preconfigured/T=0.07/0.08/0.09/0.1/input_tp.json:
  regenerated from template via gen_temps.awk
- misc/wiki/Parameters.md: document the two new parameters

Reference outputs are intentionally not updated; they will be
regenerated separately when the tutorial is next validated end-to-end.
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