Converting Sun to electricity to power a water heater is suboptimal. The water can be heated directly by the Sun. If you can put a water tank above the solar panel, you don't even need a pump.
https://en.wikipedia.org/wiki/Solar_power_at_the_White_House...
It is also true that solar water heating has unpleasant failure modes.