We calculate the x-ray absorption spectra of liquid water at ambient
conditions and of hexagonal ice close to melting, using a static GW approach
that includes approximately local field effects. Quantum dynamics of the nuclei
is taken into account by averaging the absorption cross section over molecular
configurations generated by path integral simulations. We find that inclusion
of quantum disorder is essential to bring the calculated spectra in close
agreement with experiment. In particular, the intensity of the pre-edge
feature, a spectral signature of broken and distorted hydrogen bonds, is
accurately reproduced, in water and ice, only when quantum nuclei are
considered. The effect of the local fields is less important but non
negligible, particularly in ice