K2MgH4 is (La,Ba)CuO4 structured and crystallizes in the tetragonal I4/mmm space group. K(1) is bonded in a distorted q6 geometry to four equivalent H(1) and five equivalent H(2) atoms. Mg(1) is bonded to two equivalent H(2) and four equivalent H(1) atoms to form corner-sharing MgH6 octahedra. The corner-sharing octahedra are not tilted. There are two inequivalent H sites. In the first H site, H(2) is bonded to five equivalent K(1) and one Mg(1) atom to form distorted HK5Mg octahedra that share corners with five equivalent H(2)K5Mg octahedra, corners with twelve equivalent H(1)K4Mg2 octahedra, edges with eight equivalent H(2)K5Mg octahedra, and faces with four equivalent H(1)K4Mg2 octahedra. The corner-sharing octahedral tilt angles range from 0-59°. In the second H site, H(1) is bonded to four equivalent K(1) and two equivalent Mg(1) atoms to form distorted HK4Mg2 octahedra that share corners with two equivalent H(1)K4Mg2 octahedra, corners with twelve equivalent H(2)K5Mg octahedra, edges with two equivalent H(1)K4Mg2 octahedra, faces with four equivalent H(1)K4Mg2 octahedra, and faces with four equivalent H(2)K5Mg octahedra. The corner-sharing octahedral tilt angles range from 0-59°.
K2MgH4 is (La,Ba)CuO4 structured and crystallizes in the tetragonal I4/mmm space group. K(1) is bonded in a distorted q6 geometry to four equivalent H(1) and five equivalent H(2) atoms. All K(1)-H(1) bond lengths are 2.80 Å. There is one shorter (2.82 Å) and four longer (2.84 Å) K(1)-H(2) bond lengths. Mg(1) is bonded to two equivalent H(2) and four equivalent H(1) atoms to form corner-sharing MgH6 octahedra. The corner-sharing octahedra are not tilted. Both Mg(1)-H(2) bond lengths are 2.01 Å. All Mg(1)-H(1) bond lengths are 2.00 Å. There are two inequivalent H sites. In the first H site, H(2) is bonded to five equivalent K(1) and one Mg(1) atom to form distorted HK5Mg octahedra that share corners with five equivalent H(2)K5Mg octahedra, corners with twelve equivalent H(1)K4Mg2 octahedra, edges with eight equivalent H(2)K5Mg octahedra, and faces with four equivalent H(1)K4Mg2 octahedra. The corner-sharing octahedral tilt angles range from 0-59°. In the second H site, H(1) is bonded to four equivalent K(1) and two equivalent Mg(1) atoms to form distorted HK4Mg2 octahedra that share corners with two equivalent H(1)K4Mg2 octahedra, corners with twelve equivalent H(2)K5Mg octahedra, edges with two equivalent H(1)K4Mg2 octahedra, faces with four equivalent H(1)K4Mg2 octahedra, and faces with four equivalent H(2)K5Mg octahedra. The corner-sharing octahedral tilt angles range from 0-59°.