Quantum Theory of Magnetism