Lattice Gauge Theory via LLVM-Level Automatic Differentiation
Yuki Nagai, Akio Tomiya, Hiroshi Ohno

TL;DR
This paper introduces a method to automatically generate HMC forces in lattice gauge theory by applying reverse-mode automatic differentiation at the LLVM level, enabling efficient, portable force computation from existing action code.
Contribution
It presents a novel LLVM-based automatic differentiation approach that simplifies and optimizes the generation of HMC forces directly from lattice action code, applicable across CPU and GPU.
Findings
Automatic differentiation produces forces with performance comparable to hand-written code.
The method supports both gauge and Wilson fermion actions.
It enables a single-source, compiler-optimized workflow for force generation.
Abstract
We enable the automatic construction of Hybrid Monte Carlo (HMC) forces in lattice gauge theory by performing reverse-mode automatic differentiation at the level of optimized LLVM intermediate representation, making the approach applicable to any language that lowers lattice action code to LLVM. In practice, this means that once the action evaluation routine is implemented, the corresponding HMC force can be generated automatically from the same code path, without deriving or maintaining a separate force routine. The method preserves conventional imperative, in-place implementations and enables a single-source workflow in which forces are generated directly from the action code while inheriting compiler optimizations. We perform end-to-end reverse-mode differentiation of both gauge and Wilson fermion actions. For the Wilson fermion case, we find that the force generated by automatic…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsQuantum Chromodynamics and Particle Interactions · Machine Learning in Materials Science · Particle physics theoretical and experimental studies
