Canonical density matrix perturbation theory.