  We prove that, unless P=NP, there is no polynomial-time algorithm to
approximate within some multiplicative constant the average size of an
independent set in graphs of maximum degree 6. This is a special case of a more
general result for the hard-core model defined on independent sets weighted by
a parameter $\lambda>0$. In the general setting, we prove that, unless P=NP,
for all $\Delta\geq 3$, all $\lambda>\lambda_c(\Delta)$, there is no FPTAS
which applies to all graphs of maximum degree $\Delta$ for computing the
average size of the independent set in the Gibbs distribution, where
$\lambda_c(\Delta)$ is the critical point for the uniqueness/non-uniqueness
phase transition on the $\Delta$-regular tree. Moreover, we prove that for
$\lambda$ in a dense set of this non-uniqueness region the problem is NP-hard
to approximate within some constant factor. Our work extends to the
antiferromagnetic Ising model and generalizes to all 2-spin antiferromagnetic
models, establishing hardness of computing the average magnetization in the
tree non-uniqueness region.
  Previously, Schulman, Sinclair and Srivastava (2015) showed that it is
#P-hard to compute the average magnetization exactly, but no hardness of
approximation results were known. Hardness results of Sly (2010) and Sly and
Sun (2014) for approximating the partition function do not imply hardness of
computing averages. The new ingredient in our reduction is an intricate
construction of pairs of rooted trees whose marginal distributions at the root
agree but their derivatives disagree. The main technical contribution is
controlling what marginal distributions and derivatives are achievable and
using Cauchy's functional equation to argue existence of the gadgets.
