For many years research has shown Mg deficit to be strongly related to all aspects of heart disease, including arrhythmias, irregular heartbeats, angina, ischemic heart disease, congestive heart failure, coronary heart disease and the risk factors for heart disease such as hypertension and high cholesterol.  This is a vast subject, and here are a few selected references that span the years 1934 to 2010.  You can see the PubMed abstract for each by clicking on the link.

Kruse, H. D., E. R. Orent, et al. (1932). "Studies on magnesium deficiency in animals I.  Symptomatology resulting from magnesium deprivation." J.Biol Chem 96: 519-539.

(2003). "Are you getting enough magnesium? Low levels of this key mineral may cause or worsen some heart problems." Harv Heart Lett 14(4): 5. http://www.ncbi.nlm.nih.gov/pubmed/14690986

Chocolate and Cocoa are high in Magnesium.  The next two references show how these two high-Mg foods can affect the heart.

Janszky, I., K. J. Mukamal, et al. (2009). "Chocolate consumption and mortality following a first acute myocardial infarction: the Stockholm Heart Epidemiology Program." J Intern Med 266(3): 248-57. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=19711504

Monagas, M., N. Khan, et al. (2009). "Effect of cocoa powder on the modulation of inflammatory biomarkers in patients at high risk of cardiovascular disease." Am J Clin Nutr 90(5): 1144-50. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=19776136

Fruits & vegetables are high in micronutrients, including magnesium.  The next two references show how important fruit and vegetable intakes can be in preventing heart disease:

Harriss, L. R., D. R. English, et al. (2007). Dietary patterns and cardiovascular mortality in the Melbourne Collaborative Cohort Study. 86: 221-229. http://www.ajcn.org/cgi/content/abstract/86/1/221

Hu, F. B., E. B. Rimm, et al. (2000). "Prospective study of major dietary patterns and risk of coronary heart disease in men." Am J Clin Nutr 72(4): 912-21. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=11010931

Many Mg researchers have long claimed that sudden cardiac death is highly related to low Mg status, but not until recently have low serum Mg values been correlated with sudden cardiac death.  Some follow:

Curiel-Garcia, J. A., M. Rodriguez-Moran, et al. (2008). "Hypomagnesemia and mortality in patients with type 2 diabetes." Magnes Res 21(3): 163-6. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=19009819

Peacock, J. M., T. Ohira, et al. (2010). "Serum magnesium and risk of sudden cardiac death in the Atherosclerosis Risk in Communities (ARIC) Study." Am Heart J 160(3): 464-70. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=20826254

Curiel-Garcia, J. A., M. Rodriguez-Moran, et al. (2008). "Hypomagnesemia and mortality in patients with type 2 diabetes." Magnes Res 21(3): 163-6. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=19009819

Adamopoulos, C., B. Pitt, et al. (2009). "Low serum magnesium and cardiovascular mortality in chronic heart failure: a propensity-matched study." Int J Cardiol 136(3): 270-7. http://www.ncbi.nlm.nih.gov/pubmed/18672302

Leone, N., D. Courbon, et al. (2006). "Zinc, copper, and magnesium and risks for all-cause, cancer, and cardiovascular mortality." Epidemiology 17(3): 308-14. http://www.ncbi.nlm.nih.gov/pubmed/16570028

The following study’s Abstract (for Khan et al, 2010) reports no significant finding of low serum Mg with development of aspects of heart disease, but in the paper, their Table reports significant (p = 0.04) hazard ratio for development of CVD and death when adjusted for only age and sex with Mg as a categorical variable.

Khan, A. M., L. Sullivan, et al. (2010). "Lack of association between serum magnesium and the risks of hypertension and cardiovascular disease." Am Heart J 160(4): 715-20. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=20934566

Following references are a small sampling of peer-reviewed papers on the relationship of nutritional and pharmaceutical Mg in the prevention and treatment of heart disease.

Abbott, R. D., F. Ando, et al. (2003). "Dietary magnesium intake and the future risk of coronary heart disease (the Honolulu Heart Program)." Am J Cardiol 92(6): 665-9. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=12972103

Al-Delaimy, W. K., E. B. Rimm, et al. (2004). "Magnesium intake and risk of coronary heart disease among men." J Am Coll Nutr 23(1): 63-70. http://www.ncbi.nlm.nih.gov/pubmed/14963055

Agus, M. S. and Z. S. Agus (2001). "Cardiovascular actions of magnesium." Crit Care Clin 17(1): 175-86. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=11219228

Aleksandrowicz, J. (1973). Natural environment and health. Protection of Man's Natural Environment. Cracow, Poland, Polish Sci Publ: 518-528.

Catling, L. A., I. Abubakar, et al. (2008). "A systematic review of analytical observational studies investigating the association between cardiovascular disease and drinking water hardness." J Water Health 6(4): 433-42. http://www.ncbi.nlm.nih.gov/pubmed/18401109

Monarca, S., F. Donato, et al. (2006). "Review of epidemiological studies on drinking water hardness and cardiovascular diseases." Eur J Cardiovasc Prev Rehabil 13(4): 495-506. http://www.ncbi.nlm.nih.gov/pubmed/16874137

Almoznino-Sarafian, D., S. Berman, et al. (2007). "Magnesium and C-reactive protein in heart failure: an anti-inflammatory effect of magnesium administration?" Eur J Nutr 46(4): 230-7. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=17479208

Almoznino-Sarafian, D., G. Sarafian, et al. (2009). "Magnesium administration may improve heart rate variability in patients with heart failure." Nutr Metab Cardiovasc Dis 19(9): 641-5. http://www.ncbi.nlm.nih.gov/pubmed/19201586

Alon, I., O. Gorelik, et al. (2006). "Intracellular magnesium in elderly patients with heart failure: effects of diabetes and renal dysfunction." J Trace Elem Med Biol 20(4): 221-6. http://www.ncbi.nlm.nih.gov/pubmed/17098580

Altura, B. M. (1979). "Sudden-death ischemic heart disease and dietary magnesium intake: is the target site coronary vascular smooth muscle?" Med Hypotheses 5(8): 843-8. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=390330

Altura, B. M. (1988). "Ischemic heart disease and magnesium." Magnesium 7(2): 57-67. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=3294517

Bazargan, M., M. Faghihi, et al. (2008). "Importance of timing of magnesium administration in the isolated ischemic-reperfused rat heart: role of K(ATP) channels." Physiol Res 57(6): 839-46. http://www.ncbi.nlm.nih.gov/pubmed/18052684

Chakraborti, S., T. Chakraborti, et al. (2002). "Protective role of magnesium in cardiovascular diseases: a review." Mol Cell Biochem 238(1-2): 163-79. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=12349904

Cohen, N., D. Almoznino-Sarafian, et al. (2003). "Serum magnesium aberrations in furosemide (frusemide) treated patients with congestive heart failure: pathophysiological correlates and prognostic evaluation." Heart 89(4): 411-6. http://www.ncbi.nlm.nih.gov/pubmed/12639869

Dittrich, S., J. Germanakis, et al. (2003). "Randomised trial on the influence of continuous magnesium infusion on arrhythmias following cardiopulmonary bypass surgery for congenital heart disease." Intensive Care Med 29(7): 1141-4. http://www.ncbi.nlm.nih.gov/pubmed/12774159

Franz, K. B. and S. M. Bailey (2004). "Geographical variations in heart deaths and diabetes: effect of climate and a possible relationship to magnesium." J Am Coll Nutr 23(5): 521S-524S. http://www.ncbi.nlm.nih.gov/pubmed/15466956

Fuentes, J. C., A. A. Salmon, et al. (2006). "Acute and chronic oral magnesium supplementation: effects on endothelial function, exercise capacity, and quality of life in patients with symptomatic heart failure." Congest Heart Fail 12(1): 9-13. http://www.ncbi.nlm.nih.gov/pubmed/16470086

Gao, X., L. Peng, et al. (2007). "Spironolactone reduced arrhythmia and maintained magnesium homeostasis in patients with congestive heart failure." J Card Fail 13(3): 170-7. http://www.ncbi.nlm.nih.gov/pubmed/17448413

Hoshino, K., K. Ogawa, et al. (2003). "Influence of heart surgery on magnesium concentrations in pediatric patients." Pediatr Int 45(1): 39-44. http://www.ncbi.nlm.nih.gov/pubmed/12654067

Iezhitsa, I. N. (2005). "Potassium and magnesium depletions in congestive heart failure--pathophysiology, consequences and replenishment." Clin Calcium 15(11): 123-33. http://www.ncbi.nlm.nih.gov/pubmed/16272623

Inoue, I. (2005). "[Lipid metabolism and magnesium]." Clin Calcium 15(11): 65-76. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=16272615

When Mg is low, Calcium ions rush into the cell and an imbalance is created.  When this situation persists, calcification of soft tissues can occur, as shown in the next two references:

Iribarren, C., S. Sidney, et al. (2000). "Calcification of the aortic arch: risk factors and association with coronary heart disease, stroke, and peripheral vascular disease." Jama 283(21): 2810-5. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=10838649

Zhang, A., T. P. Cheng, et al. (1992). "Magnesium regulates intracellular free ionized calcium concentration and cell geometry in vascular smooth muscle cells." Biochim Biophys Acta 1134(1): 25-9. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=1543756

Islam, J., B. F. Uretsky, et al. (2006). "Heart failure improvement with CoQ10, Hawthorn, and magnesium in a patient scheduled for cardiac resynchronization-defibrillator therapy: a case study." Explore (NY) 2(4): 339-41. http://www.ncbi.nlm.nih.gov/pubmed/16846822

Jian, W., L. Su, et al. (2003). "The effects of magnesium prime solution on magnesium levels and potassium loss in open heart surgery." Anesth Analg 96(6): 1617-20, table of contents. http://www.ncbi.nlm.nih.gov/pubmed/12760983

Khan, A. M., L. Sullivan, et al. (2010). "Lack of association between serum magnesium and the risks of hypertension and cardiovascular disease." Am Heart J 160(4): 715-20. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=20934566

Kiziltepe, U., Z. B. Eyileten, et al. (2003). "Antiarrhythmic effect of magnesium sulfate after open heart surgery: effect of blood levels." Int J Cardiol 89(2-3): 153-8. http://www.ncbi.nlm.nih.gov/pubmed/12767537

Klevay, L. M. and D. B. Milne (2002). "Low dietary magnesium increases supraventricular ectopy." Am J Clin Nutr 75(3): 550-554. http://www.ajcn.org/cgi/content/abstract/75/3/550

Launius, B. K., P. A. Brown, et al. (2004). "Osteoporosis: The dynamic relationship between magnesium and bone mineral density in the heart transplant patient." Crit Care Nurs Q 27(1): 96-100. http://www.ncbi.nlm.nih.gov/pubmed/14974529

Mathers, T. W. and R. L. Beckstrand (2009). "Oral magnesium supplementation in adults with coronary heart disease or coronary heart disease risk." J Am Acad Nurse Pract 21(12): 651-7. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=19958415

McLean, R. M. (1994). "Magnesium and its therapeutic uses: a review." Am J Med 96(1): 63-76. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=8304365

Miller, S., E. Crystal, et al. (2005). "Effects of magnesium on atrial fibrillation after cardiac surgery: a meta-analysis." Heart 91(5): 618-23. http://www.ncbi.nlm.nih.gov/pubmed/15831645

Morrill, G. A., R. K. Gupta, et al. (1997). "Mg2+ modulates membrane lipids in vascular smooth muscle: a link to atherogenesis." FEBS Lett 408(2): 191-4. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=9187365

Nagase, N. (1996). "Hypertension and serum Mg in the patients with diabetes and coronary heart disease." Hypertens Res 19 Suppl 1: S65-8. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=9240768

Nielsen, F. H., D. B. Milne, et al. (2007). "Dietary magnesium deficiency induces heart rhythm changes, impairs glucose tolerance, and decreases serum cholesterol in post menopausal women." J Am Coll Nutr 26(2): 121-32. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=17536123

Ohtsuka, S. and I. Yamaguchi (2005). "[Magnesium in congestive heart failure]." Clin Calcium 15(2): 181-6. http://www.ncbi.nlm.nih.gov/pubmed/15692155

Oladapo, O. O. and A. O. Falase (2000). "Serum and urinary magnesium during treatment of patients with chronic congestive heart failure." Afr J Med Med Sci 29(3-4): 301-3. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=11714011

Omiya, K., Y. J. Akashi, et al. (2009). "Heart-rate response to sympathetic nervous stimulation, exercise, and magnesium concentration in various sleep conditions." Int J Sport Nutr Exerc Metab 19(2): 127-35. http://www.ncbi.nlm.nih.gov/pubmed/19478338

Orlov, M. V., M. A. Brodsky, et al. (1994). "A review of magnesium, acute myocardial infarction and arrhythmia." J Am Coll Nutr 13(2): 127-32. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=8006293

Pokan, R., P. Hofmann, et al. (2006). "Oral magnesium therapy, exercise heart rate, exercise tolerance, and myocardial function in coronary artery disease patients." Br J Sports Med 40(9): 773-8. http://www.ncbi.nlm.nih.gov/pubmed/16825271

Sanders, G. T., H. J. Huijgen, et al. (1999). "Magnesium in disease: a review with special emphasis on the serum ionized magnesium." Clin Chem Lab Med 37(11-12): 1011-33. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=10726809

Seelig, M. S. and H. A. Heggtveit (1974). "Magnesium interrelationships in ischemic heart disease: a review." Am J Clin Nutr 27(1): 59-79. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=4588182

Shirey, T. L. (2004). "Monitoring magnesium to guide magnesium therapy for heart surgery." J Anesth 18(2): 118-28. http://www.ncbi.nlm.nih.gov/pubmed/15127260

Speziale, G., G. Ruvolo, et al. (2000). "Arrhythmia prophylaxis after coronary artery bypass grafting: regimens of magnesium sulfate administration." Thorac Cardiovasc Surg 48(1): 22-6. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=10757152

Stepura, O. B. and A. I. Martynow (2009). "Magnesium orotate in severe congestive heart failure (MACH)." Int J Cardiol 131(2): 293-5. http://www.ncbi.nlm.nih.gov/pubmed/18281113

Takase, B., T. Akima, et al. (2004). "Effects of chronic sleep deprivation on autonomic activity by examining heart rate variability, plasma catecholamine, and intracellular magnesium levels." Biomed Pharmacother 58 Suppl 1: S35-9. http://www.ncbi.nlm.nih.gov/pubmed/15754837

Ueshima, K. (2005). "Magnesium and ischemic heart disease: a review of epidemiological, experimental, and clinical evidences." Magnes Res 18(4): 275-84. http://www.ncbi.nlm.nih.gov/pubmed/16548143

Vlad, M., G. Uza, et al. (2000). "Magnesium and calcium concentration in the abdominal aorta of patients deceased by ischemic heart disease." Magnes Res 13(1): 37-41. http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=10761189

Yokoyama, A., K. Kikuchi, et al. (2005). "[Heart rate variability, arrhythmia and magnesium in hemodialysis patients]." Clin Calcium 15(2): 226-32. http://www.ncbi.nlm.nih.gov/pubmed/15692161