Chapter 3 Density functional theory of the ground-state magnetic properties of rare earths and actinides