Introducing a get_total_magnetization() function.