SMS dit: Trace element partitioning and defects in perovskites