  Determining the electronic and dielectric properties of water at high
pressure and temperature is an essential prerequisite to understand the
physical and chemical properties of aqueous environments under supercritical
conditions, e.g. in the Earth interior. However optical measurements of
compressed ice and water remain challenging and it has been common practice to
assume that their band gap is inversely correlated to the measured refractive
index, consistent with observations reported for hundreds of materials. Here we
report ab initio molecular dynamics and electronic structure calculations
showing that both the refractive index and the electronic gap of water and ice
increase with pressure, at least up to 30 GPa. Subtle electronic effects,
related to the nature of interband transitions and band edge localization under
pressure, are responsible for this apparently anomalous behavior.
