Fig. 3: Chloride inclusion in the crystal structure.

ToF-SIMS analysis of a horizontal and b vertical thin films deposited onto ITO substrates, showing an increasing Cl distribution from the surface towards the bottom edge of the vertical sample. c GIWAXS pattern of horizontal (in yellow) and vertical (in red) LDP thin films in the 0.5–1 nm−1 q range. d Simulated phase diagram for the thermodynamic analysis of Cl-incorporation at I-sites in TMA2MAPb2I7 and, e b-lattice parameter for 1121 different DFT optimized structures randomly and uniformly distributed over 0 < x < 0.21 and 0.79 < x < 1 for x in I1–xClx. For clarity, to show the stability region (white, marked S), we have broken the x-axis at x = 0.21 and 0.79, between which the unstable region (pink, marked U) continues. The metastable region is indicated by the blue shadowing and marked with M. f Unit cells of x = 0.21 Cl at I-sites with the maximum (top) and minimum (bottom) b-lattice parameters. The spacer cations are omitted for clarity.