Rare earth doped ceria: The complex connection between structure and properties