To rationalize the observed spectra, several theoretical structures were validated by density functional theory (DFT) simulation before being used to simulate the potassium K-edge XANES. The electronic and structural properties of K + inclusion within the ideal PB structure verified that the ion sits in half of the center of the primitive cubic structural cavities (8c sites), in an ordered tetrahedral pattern (as shown in Scheme 1a). Analysis of the electronic density of states (DOS) is consistent with the expected changes in Fe oxidation and spin states on removing all K + (BG), or when fully oxidizing the system by filling all 8c sites (PW) (Figure ). Next, the inclusion of H 2 O was considered in competition with K + for the 8c site, which would increase the distance between intercalated K + , as it is pushed towards the corners of the primitive cell into the 32f' position (Figures &). Increasing the water content from 4 to 16 H 2 O molecules per unit cell pushes the K + further away from the central 8c site, with the inclusion of 8 H 2 O calculated as the most thermodynamically viable. Finally, the influence of the Fe II (CN) 6 defects was considered by the removal of the central Fe II (CN) 6 octahedra and addition of a (H 2 O) 6 cluster. In this scenario K + has been considered in two locations (Figure ). When K + was considered within the cavities, it was pushed away from the 8c site towards the 32f' position, relative to the ideal water free PB structure. The enthalpy of formation (ΔH form ) of this intercalated structure is higher with the inclusion of the defect, supporting notions that structural defects would inhibit K + intercalation. Alternatively, K + was considered within the central (H 2 O) 6 cluster (equivalent to Scheme 1b), with ΔH form at comparable K + loading less favorable than for the defective system with K + within the channel. Therefore, K + is unlikely to be located within this defect site.