Rb3MgH5 crystallizes in the tetragonal P4/ncc space group. There are two inequivalent Rb sites. In the first Rb site, Rb(1) is bonded in a 6-coordinate geometry to two equivalent H(1) and four equivalent H(2) atoms. In the second Rb site, Rb(2) is bonded to two equivalent H(1) and four equivalent H(2) atoms to form distorted RbH6 pentagonal pyramids that share corners with two equivalent Rb(2)H6 pentagonal pyramids, corners with four equivalent Mg(1)H4 tetrahedra, and edges with four equivalent Rb(2)H6 pentagonal pyramids. Mg(1) is bonded to four equivalent H(2) atoms to form MgH4 tetrahedra that share corners with eight equivalent Rb(2)H6 pentagonal pyramids. There are two inequivalent H sites. In the first H site, H(1) is bonded to two equivalent Rb(1) and four equivalent Rb(2) atoms to form distorted corner-sharing HRb6 octahedra. The corner-sharing octahedral tilt angles range from 0-28°. In the second H site, H(2) is bonded in a distorted rectangular see-saw-like geometry to one Rb(1), two equivalent Rb(2), and one Mg(1) atom.
Rb3MgH5 crystallizes in the tetragonal P4/ncc space group. There are two inequivalent Rb sites. In the first Rb site, Rb(1) is bonded in a 6-coordinate geometry to two equivalent H(1) and four equivalent H(2) atoms. There is one shorter (2.97 Å) and one longer (3.20 Å) Rb(1)-H(1) bond length. All Rb(1)-H(2) bond lengths are 3.08 Å. In the second Rb site, Rb(2) is bonded to two equivalent H(1) and four equivalent H(2) atoms to form distorted RbH6 pentagonal pyramids that share corners with two equivalent Rb(2)H6 pentagonal pyramids, corners with four equivalent Mg(1)H4 tetrahedra, and edges with four equivalent Rb(2)H6 pentagonal pyramids. Both Rb(2)-H(1) bond lengths are 2.95 Å. There are two shorter (2.90 Å) and two longer (3.04 Å) Rb(2)-H(2) bond lengths. Mg(1) is bonded to four equivalent H(2) atoms to form MgH4 tetrahedra that share corners with eight equivalent Rb(2)H6 pentagonal pyramids. All Mg(1)-H(2) bond lengths are 1.86 Å. There are two inequivalent H sites. In the first H site, H(1) is bonded to two equivalent Rb(1) and four equivalent Rb(2) atoms to form distorted corner-sharing HRb6 octahedra. The corner-sharing octahedral tilt angles range from 0-28°. In the second H site, H(2) is bonded in a distorted rectangular see-saw-like geometry to one Rb(1), two equivalent Rb(2), and one Mg(1) atom.