Structural, thermodynamic, electronic, and optical properties of NaH from first-principles calculations