Hello,
I've been doing a lot of researching on magnesium and I've found that magnesium deficiency (also called "hypomagnesemia" or "hypomagnesium"), can cause: depression, anxiety, panic attacks, and other conditions.
Recently, I've been learning that it can cause psychosis, too, and I found a supportive medical report:
(PsychosomaticMedicine)
http://www.psychosomaticmedicine.org/cgi/reprint/57/3/299.