  As the size of quantum devices continues to grow, the development of scalable
methods to characterise and diagnose noise is becoming an increasingly
important problem. Recent methods have shown how to efficiently estimate
Hamiltonians in principle, but they are poorly conditioned and can only
characterize the system up to a scalar factor, making them difficult to use in
practice. In this work we present a Bayesian methodology, called Bayesian
Hamiltonian Learning (BHL), that addresses both of these issues by making use
of any or all, of the following: well-characterised experimental control of
Hamiltonian couplings, the preparation of multiple states, and the availability
of any prior information for the Hamiltonian. Importantly, BHL can be used
online as an adaptive measurement protocol, updating estimates and their
corresponding uncertainties as experimental data become available. In addition,
we show that multiple input states and control fields enable BHL to reconstruct
Hamiltonians that are neither generic nor spatially local. We demonstrate the
scalability and accuracy of our method with numerical simulations on up to 100
qubits. These practical results are complemented by several theoretical
contributions. We prove that a $k$-body Hamiltonian $H$ whose correlation
matrix has a spectral gap $\Delta$ can be estimated to precision $\varepsilon$
with only $\tilde{O}\bigl(n^{3k}/(\varepsilon \Delta)^{3/2}\bigr)$
measurements. We use two subroutines that may be of independent interest:
First, an algorithm to approximate a steady state of $H$ starting from an
arbitrary input that converges factorially in the number of samples; and
second, an algorithm to estimate the expectation values of $m$ Pauli operators
with weight $\le k$ to precision $\epsilon$ using only $O(\epsilon^{-2} 3^k
\log m)$ measurements, which quadratically improves a recent result by Cotler
and Wilczek.
