Yoga exercises could stimulate the passage of (green) food and/or (originally green) bile through your bowel, and then either the food or bile would color the stool green. If stools are loose and contain undigested food, you are losing nutrients this way.
Excessive use of magnesium supplements can be toxic. The upper limit -- the highest dose a person can take -- of magnesium supplements is: 65 mg/day for children ages 1-3. 110 mg/day for children ages 4-8. 350 mg/day for adults and children ages 9 and up.
The calcium I take has magnesium in it. Each tablet contains 250mg of calcium and 125mg of magnesium, plus 100 units of vitamin D3. If you are going to take a calcium supplement this is what you need. Make sure it has magnesium in the pill or capsule. They make this way so to be sure you get the magnesium along with the calcium. Plus you get a little D3 with it.