  The Green-Kubo theory of thermal transport has long be considered
incompatible with modern simulation methods based on electronic-structure
theory, because it is based on such concepts as energy density and current,
which are ill-defined at the quantum-mechanical level. Besides, experience with
classical simulations indicates that the estimate of heat-transport
coefficients requires analysing molecular trajectories that are more than one
order of magnitude longer than deemed feasible using ab initio molecular
dynamics. In this paper we report on recent theoretical advances that are
allowing one to overcome these two obstacles. First, a general gauge invariance
principle has been established, stating that thermal conductivity is
insensitive to many details of the microscopic expression for the energy
density and current from which it is derived, thus permitting to establish a
rigorous expression for the energy flux from Density-Functional Theory, from
which the conductivity can be computed in practice. Second, a novel data
analysis method based on the statistical theory of time series has been
proposed, which allows one to considerably reduce the simulation time required
to achieve a target accuracy on the computed conductivity. These concepts are
illustrated in detail, starting from a pedagogical introduction to the
Green-Kubo theory of linear response and transport, and demonstrated with a few
applications done with both classical and quantum-mechanical simulation
methods.
