  The anomalous magnetic moment of the muon, a_mu, has been measured with an
overall precision of 540 ppb by the E821 experiment at BNL. Since the
publication of this result in 2004 there has been a persistent tension of 3.5
standard deviations with the theoretical prediction of a_mu based on the
Standard Model. The uncertainty of the latter is dominated by the effects of
the strong interaction, notably the hadronic vacuum polarisation (HVP) and the
hadronic light-by-light (HLbL) scattering contributions, which are commonly
evaluated using a data-driven approach and hadronic models, respectively. Given
that the discrepancy between theory and experiment is currently one of the most
intriguing hints for a possible failure of the Standard Model, it is of
paramount importance to determine both the HVP and HLbL contributions from
first principles. In this review we present the status of lattice QCD
calculations of the leading-order HVP and the HLbL scattering contributions,
a_mu^hvp and a_mu^hlbl. After describing the formalism to express a_mu^hvp and
a_mu^hlbl in terms of Euclidean correlation functions that can be computed on
the lattice, we focus on the systematic effects that must be controlled to
achieve a first-principles determination of the dominant strong interaction
contributions to a_mu with the desired level of precision. We also present an
overview of current lattice QCD results for a_mu^hvp and a_mu^hlbl, as well as
related quantities such as the transition form factor for pi0 -> gamma*gamma*.
While the total error of current lattice QCD estimates of a_mu^hvp has reached
the few-percent level, it must be further reduced by a factor 5 to be
competitive with the data-driven dispersive approach. At the same time, there
has been good progress towards the determination of a_mu^hlbl with an
uncertainty at the 10-15%-level.
