Fidelity approach to the Hubbard model