The phase diagrams of water and ammonia were determined by constant pressur
e ab initio molecular dynamic simulations at pressures (30 to 300 gigapasca
l) and temperatures (300 to 7000 kelvin) of relevance for the middle ice la
yers of the giant planets Neptune and Uranus. Along the planetary isentrope
water and ammonia behave as fully dissociated ionic, electronically insula
ting fluid phases, which turn metallic at temperatures exceeding 7000 kelvi
n for water and 5500 kelvin for ammonia. At lower temperatures, the phase d
iagrams of water and ammonia exhibit a superionic solid phase between the s
olid and the ionic liquid. These simulations improve our understanding of t
he properties of the middle ice Layers of Neptune and Uranus.