Feature/direct grid chi0#370
Draft
PDoakORNL wants to merge 7 commits into
Draft
Conversation
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.
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.
This returns the C++ main_analysis code to a working state.