Hi boatman,
well magnesium (as with any other mineral) is essential for a number of biological and physiological processes, one of which is a benefit to the heart muscle, but any form of external nutrition while fasting, is tantamount to breaking the fast, which reduces its benefits and prevents full ketosis.
The need for minerals on a Water Fast is supplied by the body and its food reserves, so taking magnesium as a supplement while fasting is unnecessary..........
The minerals that are obtained from drinking water, are mostly if not entirely, inorganic and of no use to the body, so the use of distilled water is the most recommended form as the most pure.
The majority of minerals are obtained from food which is in the bioavailable and organic form.