SURPRISES: When ab initio meets statistics in extended systems