The equation of state of solid molecular hydrogen and deuterium