## 2 Materials and Methods
\(f^{\prime}\) and \(f^{\prime\prime}\) are constants, and \(f\) is a function of the scattering angle (momentum transfer; \(Q\) (= 2\(\pi\)/\(d\) = 4\(\pi\)sin\(\theta\)/\(\lambda\))) when the X-ray energy is far from the absorption edge, though \(f\) changes with \(f^{\prime}\) and \(f^{\prime\prime}\) depending on the energy because of resonant absorption when the energy is near excitation. Typically, the absolute intensity is measured to evaluate the occupation ratio by Rietveld refinement [48]. However, it is difficult for the Ti K-edge (approximately 4.9 keV) to use the Rietveld method because of unignorable absorption in air and fewer Bragg peaks due to the limited \(Q\) range. Thus, the relative intensity was evaluated to identify the substitution site of Ti in NaAlH\({}_{4}\). The Ti K-edge X-ray absorption fine structure was measured at BL9A at the Photon Factory, KEK. Because the amount of Ti is small, the spectra were measured in fluorescence modes to compensate for the low signal-to-noise ratio. The samples were sealed in a polyethylene bag in a glove box. A line was regressed to the obtained data in the pre-edge range (-150 to -30 eV from the absorption edge), and a spline was regressed to the data in the post-edge range (150 to 990 eV). The differences were normalized using the software Athena [49]. The absorption edge of NaAlH\({}_{4}\)-TiCl\({}_{3}\) was determined to be 0.5 by normalization of the range higher than 4.9965 keV (Ti calibrated edge). The edge shift was determined from the oxidation states of the standard samples (Ti: 0, TiO: 2, Ti\({}_{2}\)O\({}_{3}\): 3, TiO: 4), as shown in Figure S2. The EXAFS spectrum, \(\chi\), against the wavenumber k can be expressed as:  
\[\chi(k)=S_{0}^{2}\sum_{j}\frac{N_{j}F_{j}(k)exp\left(-2k^{2}\sigma_{j}^{2} \right)}{kr_{j}^{2}}\sin\left(2 kr_{j}+\phi_{j}(k)\right) \tag{6}\]  
where \(S_{0}^{2}\) is an intrinsic loss factor, \(N_{j}\) is the coordination number, \(F_{j}(k)\) is the backscattering factor, \(\sigma_{j}\) is the Debye-Waller factor, \(\phi_{j}\) is the phase factor, and \(r\) is the interatomic distance. \(S_{0}^{2}\) was determined to be 0.61 using a standard Ti film sample. The radial distribution functions obtained from the EXAFS spectra were fitted using the software Artemis [49]. The ground-state (0 K) thermodynamic stability of Na(Al, Ti)H\({}_{4}\) was investigated using first-principles density functional theory (DFT) calculations as implemented in the Vienna ab initio simulation package (VASP) [50; 51] with a plane-wave basis and the projector augmented wave method [52; 53] within the generalized gradient approximation with the Perdew-Burke-Ernzerhof exchange-correlation functional [54]. A cutoff energy of 780 eV and a Gaussian smearing method with an energy broadening of 0.2 eV were used throughout. The k-mesh generated using the Monkhorst-Pack method had a spacing of less than 0.5 A\({}^{-1}\). The criterion for self-consistency in the electronic structure determination was that two consecutive energies differed by less than 0.1 meV. The ground-state energetics of the elements and compounds in their most stable standard state phase, Na metal (\(Im\overline{3}m\)), Al metal (\(Fm\overline{3}m\)), Ti metal (\(P6_{3}/mmc\)), and H\({}_{2}\) molecule gas (15 \(\times\) 15 \(\times\) 15 A\({}^{3}\), nonspin-polarized) were used to determine the thermodynamic changes for the NaAlH\({}_{4}\) (\(I4_{1}/a\)) doping reactions. The ground state geometries of Na(Al, Ti)H\({}_{4}\) were determined by minimizing the Hellman-Feynman forces with the residual minimization method-direct inversion in the iterative subspace (RMM-DIIS) implementation of the quasi-Newton method. Full minimization of the atomic coordinates, cell size, and cell shape was conducted simultaneously. The structure was relaxed when all the forces of the nonfixed atoms were <0.05 eV/A.