Density functional approach to quantum lattice systems