TAP Gibbs Free Energy, Belief Propagation and Sparsity