Title: Ab initio Theory of Magnetic Ordering