A study of the electronic states and local environments of iron impurities in lithium niobate and lanthanum hexaboride