STEM-HAADF Z-contrast image simulation was carried out using the QSTEM software32. A C s value of 1 µm, a C c value of 1 mm and an energy spread of 0.7 eV were assumed; higher order aberrations were neglected. For the convergence angle and the HAADF detector the values listed in the previous paragraph were used. Thermal diffuse scattering was not considered. For the simulation two structural modifications were used: pure SmCo3 (space group R-3m) and Zr2SmCo9, which is essentially the same as the pure compound, but with the Sm1 (6c) atomic position (6c, x = 0, y = 0, z = 0.141) replaced with Zr. STEM-HAADF images were Wiener filtered for noise reduction36. Selected STEM-HAADF images were filtered using a 5–15 component principal component analysis for improved noise reduction37.