  In this paper we study the emergence of steady electric currents in QCD as a
response to a non-uniform magnetic background using lattice simulations with 2
+ 1 quark flavors at the physical point, as well as leading-order chiral
perturbation theory. Using these currents, we develop a novel method to
determine the leading-order coefficient of the equation of state in a magnetic
field expansion: the magnetic susceptibility of the QCD medium. We decompose
the current expectation value into valence- and sea-quark contributions and
demonstrate that the dominant contribution to the electric current is captured
by the valence term alone, allowing for a comparably cheap determination of the
susceptibility. Our continuum extrapolated lattice results for the equation of
state confirm the findings of some of the existing studies in the literature,
namely that the QCD medium behaves diamagnetically at low and paramagnetically
at high temperatures.
