Michael Z. answered 12/10/20
Recent European Medical School Graduate
Magnesium (Mg)
Calcium, usually in the form of calcium carbonate (chalk), is used to decrease the acidity of soil, making it more favorable for cultivation of most crops.
Magnesium carbonate (mineral dolomite) will have the same effect on soil pH.
Potassium acts differently. It is one of the main nutrients nesessary for biomass synthesis: agrochemistry term for those macronutrients in soils and fertilizers is NPK: nitrogen, phosphorus and potassium.