Skip to content

MILC interface: Exact current#1633

Open
leonhostetler wants to merge 23 commits into
developfrom
feature/milc-exact-current
Open

MILC interface: Exact current#1633
leonhostetler wants to merge 23 commits into
developfrom
feature/milc-exact-current

Conversation

@leonhostetler
Copy link
Copy Markdown
Contributor

This is the second and final PR in the series to enable exact current calculations for HVP in the MILC/QUDA interface. The previous PR was #1590 .

Changes:

  1. Adds a new MILC interface function, qudaExactCurrent, in lib/milc_interface.cpp. This computes the exact low-mode contribution to the current densities needed for HVP current calculations.

  2. Implements eigenvalue shifting in the MILC interface for preserved deflation spaces. Previously, when using a preserved deflation space across multiple solves, the eigenvalues were recomputed each time the mass changed. With this update, computeEvals is called only once, during the first solve. The resulting zero-mass eigenvalues are cached and shifted as needed for subsequent masses.

    This avoids many unnecessary mat-vecs and greatly reduces output volume: eigenvalues are now printed only once instead of once per solve, which previously could produce O(10^6) lines of eigenvalue output in a typical production run.

  3. Makes lib/eig_block_trlm.cpp and lib/eig_trlm.cpp slightly more verbose by printing progress notifications every 10th or 100th Lanczos step. On production-size lattices, eigensolves can otherwise run for more than an hour without any visible progress, which can make a normally progressing job appear to be stalled.

Testing:

  • Verified exact-current results against the corresponding MILC-side implementation.
  • Verified that preserved deflation spaces reuse cached zero-mass eigenvalues and shift them correctly for subsequent masses.

@leonhostetler leonhostetler requested a review from a team as a code owner May 26, 2026 18:03
Copy link
Copy Markdown
Member

@maddyscientist maddyscientist left a comment

Choose a reason for hiding this comment

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

This looks good to me. I'll leave @weinbe2 to comment on the MILC interface specifics. I've left a couple of comments.

Comment thread lib/eig_trlm.cpp Outdated
Comment thread lib/milc_interface.cpp Outdated
Comment thread lib/milc_interface.cpp Outdated
Comment thread lib/milc_interface.cpp Outdated
@maddyscientist
Copy link
Copy Markdown
Member

Thanks for the tweaks @leonhostetler. I've left a couple of non-essential comments that might be nice to update if you make another push.

@weinbe2 any thoughts before we merge?

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