We study the problem of learning a local quantum Hamiltonian H given copies of its Gibbs state ρ = e−β H/(e−β H) at a known inverse temperature β>0. Anshu, Arunachalam, Kuwahara, and Soleimanifar gave an algorithm to learn a Hamiltonian on n qubits to precision with only polynomially many copies of the Gibbs state, but which takes exponential time. Obtaining a computationally efficient algorithm has been a major open problem, with prior work only resolving this in the limited cases of high temperature or commuting terms. We fully resolve this problem, giving a polynomial time algorithm for learning H to precision from polynomially many copies of the Gibbs state at any constant β > 0. Our main technical contribution is a new flat polynomial approximation to the exponential function, and a translation between multi-variate scalar polynomials and nested commutators. This enables us to formulate Hamiltonian learning as a polynomial system. We then show that solving a low-degree sum-of-squares relaxation of this polynomial system suffices to accurately learn the Hamiltonian.
Abstract. We study the problem of learning a local quantum Hamiltonian [Formula: see text] given copies of its Gibbs state [Formula: see text] at a known inverse temperature [Formula: see text]. Anshu et al. [2020 IEEE 61st Annual Symposium on Foundations of Computer Science, pp. 685–691] gave an algorithm to learn a Hamiltonian on [Formula: see text] qubits to precision [Formula: see text] with only polynomially many copies of the Gibbs state, but which takes exponential time. Obtaining a computationally efficient algorithm has been a major open problem [ Alhambra, PRX Quantum, 4 (2023), 040201 ; Anshu and Arunachalam, Nature Rev. Phys., 6 (2023), pp. 59–69 ], with prior work only resolving this in the limited cases of high temperature [ Haah, Kothari, and Tang, Markov field on finite graphs and lattices, 1971 ] or commuting terms [ Anshu et al., Efficient learning of commuting Hamiltonians on lattices, 2021 ]. We fully resolve this problem, giving a polynomial time algorithm for learning [Formula: see text] to precision [Formula: see text] from polynomially many copies of the Gibbs state at any constant [Formula: see text]. Our main technical contribution is a new flat polynomial approximation to the exponential function, and a translation between multivariate scalar polynomials and nested commutators. This enables us to formulate Hamiltonian learning as a polynomial system. We then show that solving a low-degree sum-of-squares relaxation of this polynomial system suffices to accurately learn the Hamiltonian.
We consider the problem of learning local quantum Hamiltonians given copies of their Gibbs state at a known inverse temperature, following Haah et al. [2108.04842] and Bakshi et al. [arXiv:2310.02243]. Our main technical contribution is a new flat polynomial approximation of the exponential function based on the Chebyshev expansion, which enables the formulation of learning quantum Hamiltonians as a polynomial optimization problem. This, in turn, can benefit from the use of moment/SOS relaxations, whose polynomial bit complexity requires careful analysis [O'Donnell, ITCS 2017]. Finally, we show that learning a
k-local Hamiltonian, whose dual interaction graph is of bounded degree, runs in polynomial time under mild assumptions.
In this work, we study the problems of certifying and learning quantum
k-local Hamiltonians, for a constant
k. Our main contributions are as follows:
- Certification of Hamiltonians. We show that certifying a local Hamiltonian in normalized Frobenius norm via access to its time-evolution operator can be achieved with only
O(1/ε) evolution time. This is optimal, as it matches the Heisenberg-scaling lower bound of
Ω(1/ε). To our knowledge, this is the first optimal algorithm for testing a Hamiltonian property. A key ingredient in our analysis is the Bonami Hypercontractivity Lemma from Fourier analysis.
- Learning Gibbs states. We design an algorithm for learning Gibbs states of local Hamiltonians in trace norm that is sample-efficient in all relevant parameters. In contrast, previous approaches learned the underlying Hamiltonian (which implies learning the Gibbs state), and thus inevitably suffered from exponential sample complexity scaling in the inverse temperature.
- Certification of Gibbs states. We give an algorithm for certifying Gibbs states of local Hamiltonians in trace norm that is both sample and time-efficient in all relevant parameters, thereby solving a question posed by Anshu (Harvard Data Science Review, 2022).
We study the problem of learning a Hamiltonian H to precision
ε, supposing we are given copies of its Gibbs state
ρ=exp(−βH)/Tr(exp(−βH)) at a known inverse temperature
β. Anshu, Arunachalam, Kuwahara, and Soleimanifar [AAKS21] recently studied the sample complexity (number of copies of
ρ needed) of this problem for geometrically local N-qubit Hamiltonians. In the high-temperature (low
β) regime, their algorithm has sample complexity poly (N, 1/
β, 1/
ε) and can be implemented with polynomial, but suboptimal, time complexity. In this paper, we study the same question for a more general class of Hamiltonians. We show how to learn the coefficients of a Hamiltonian to error
ε with sample complexity
S=O(logN/(βε)2) and time complexity linear in the sample size, O(SN). Furthermore, we prove a matching lower bound showing that our algorithm’s sample complexity is optimal, and hence our time complexity is also optimal. In the appendix, we show that virtually the same algorithm can be used to learn H from a real-time evolution unitary
e−itH in a small t regime with similar sample and time complexity.
We study the problem of learning the dense Sachdev--Ye--Kitaev (SYK) Hamiltonian from copies of its Gibbs state. Existing algorithms for Hamiltonian learning typically rely on geometric locality or bounded interaction degree and therefore do not apply to SYK, where each quartic interaction overlaps with
Θ(n3) others. We show that this obstruction can be overcome by exploiting the random mean-field structure of the model. At any constant temperature, we prove that with high probability over the SYK couplings, the entire Hamiltonian can be learned to inverse-polynomial accuracy using polynomially many samples. Furthermore, when the inverse temperature is restricted to be a sufficiently small constant, we construct a quasipolynomial-time learning algorithm which is qualitatively different from the sample-efficient algorithm.
We study the problem of learning a finite-range quantum Hamiltonian on an
n-qubit
D-dimensional lattice from copies of its Gibbs states at a known inverse temperature
β or its thermal metastable states. Existing efficient algorithms at arbitrary temperature have sample guarantees with an $e^{\poly(β)}$ dependence, leaving open whether the exponent can be made linear in
β. We achieve this improvement: for
β≥1, our algorithm learns all Hamiltonian coefficients to
ℓ∞-error
ε with probability at least
1−δ using $\tO\bigl(e^{O(β)}ε^{-2}\log(n/δ)\bigr)$ copies and total time $\tO\bigl(n e^{O(β)}ε^{-2}\log(n/δ)\bigr)$. The measurements act on individual copies and are supported on balls of radius
O(β2+βlog(1/ε)). Our sample complexity achieves the optimal exponential order in
β, with optimal
ε−2 dependence up to logarithmic factors.
Building on the stationarity-test framework \citep{Bergamaschi2026Stationarity}, we prove a unified Fisher-information coercivity bound showing that errors in the candidate Hamiltonian produce a detectable signal with only an
e−O(β) loss in sensitivity. The key is a smooth frequency filter whose bandwidth remains independent of temperature, together with sharper estimates relating this signal to the Hamiltonian coefficients. For thermal metastable states, the guarantee holds under local drift
ζ≤e−Cβ2D+1, for a geometry-dependent constant
C>0, and above an accuracy floor $\tO(e^{O(β)}ζ)$. The argument applies to both Gibbs and thermal metastable states and, combined with local measurements and projected stochastic gradient descent (SGD), yields both learning guarantees.