Table of Contents
Fetching ...

From Paper to Program: A Multi-Stage LLM-Assisted Workflow for Accelerating Quantum Many-Body Algorithm Development

Yi Zhou

Abstract

Translating quantum many-body theory into scalable software traditionally requires months of effort. Zero-shot generation of tensor network algorithms by Large Language Models (LLMs) frequently fails due to spatial reasoning errors and memory bottlenecks. We resolve this using a multi-stage workflow that mimics a physics research group. By generating a mathematically rigorous LaTeX specification as an intermediate blueprint, we constrain the coding LLM to produce exact, matrix-free $\mathcal{O}(D^3)$ operations. We validate this approach by generating a Density-Matrix Renormalization Group (DMRG) engine that accurately captures the critical entanglement scaling of the Spin-$1/2$ Heisenberg model and the symmetry-protected topological (SPT) order of the Spin-$1$ AKLT model. Testing across 16 combinations of leading foundation models yielded a 100\% success rate. By compressing a months-long development cycle into under 24 hours ($\sim 14$ active hours), this framework offers a highly reproducible paradigm for accelerating computational physics research.

From Paper to Program: A Multi-Stage LLM-Assisted Workflow for Accelerating Quantum Many-Body Algorithm Development

Abstract

Translating quantum many-body theory into scalable software traditionally requires months of effort. Zero-shot generation of tensor network algorithms by Large Language Models (LLMs) frequently fails due to spatial reasoning errors and memory bottlenecks. We resolve this using a multi-stage workflow that mimics a physics research group. By generating a mathematically rigorous LaTeX specification as an intermediate blueprint, we constrain the coding LLM to produce exact, matrix-free operations. We validate this approach by generating a Density-Matrix Renormalization Group (DMRG) engine that accurately captures the critical entanglement scaling of the Spin- Heisenberg model and the symmetry-protected topological (SPT) order of the Spin- AKLT model. Testing across 16 combinations of leading foundation models yielded a 100\% success rate. By compressing a months-long development cycle into under 24 hours ( active hours), this framework offers a highly reproducible paradigm for accelerating computational physics research.

Paper Structure

This paper contains 10 sections, 1 equation, 3 figures, 1 table.

Figures (3)

  • Figure 1: The "Paper to Program" Multi-Agent Workflow. The development process mimics a virtual research group. (A) The theoretical source material. (B) A zero-shot translation by LLM-0 ("Junior Theorist") yields a flawed initial draft, characterized by hallucinated tensor indices and severe memory scaling bottlenecks. (C) The crucial intermediate step: LLM-1 ("Senior Postdoc") reviews and corrects the draft, generating a mathematically rigorous formal specification. This stage enforces universal index conventions and explicit memory optimizations (e.g., optimize=True). (D) Constrained by this strict blueprint, LLM-2 ("Coder") reliably generates scalable Python code. The Human PI remains in the loop strictly for high-level physics verification and pedagogical feedback.
  • Figure 2: The Accelerated Development Timeline. The complete workflow—from parsing the theoretical review paper to finalizing a verified, matrix-free DMRG codebase—was executed in under 24 hours of wall-clock time. This required approximately 14 hours of active, human-in-the-loop collaboration, representing a massive acceleration compared to traditional 3-to-6-month development cycles.
  • Figure 3: Physics Verification and Scaling Benchmarks. The AI-generated codebase accurately captures the distinct physics of critical and gapped topological phases. (a) Ground state energy $E_0$ of the $L=12$ Heisenberg chain extrapolated against the inverse bond dimension $1/D$. (b) Finite-size scaling of the Heisenberg ground state energy density $E_0/L$ versus $1/L$, accurately extrapolating to the exact Bethe Ansatz thermodynamic limit ($e_\infty = -0.4431$). (c) Bipartite entanglement entropy profile for the $L=12$ Heisenberg chain, exhibiting expected even-odd boundary oscillations and matching the Conformal Field Theory (CFT) prediction for central charge $c=1$. (d) Ground state energy of the AKLT model perfectly matching the exact analytical formula across various system sizes. (e) Bond entanglement entropy for the AKLT model ($D=2$), showing the bulk bonds plateauing exactly at $\ln 2 \approx 0.6931$, reflecting the fractionalized virtual spin-$1/2$ singlets of the valence-bond solid state. (f) The non-local string order parameter perfectly plateauing at the theoretical value of $-4/9$, confirming the symmetry-protected topological (SPT) order of the Haldane phase.