This research proposes a new efficient algorithm for calculating the square root function of the large-scale nonsingular sparse matrix by restarting the Heavy Ball Algorithm. The square root matrix function is critical in various applications, including signal processing, image processing, and machine learning. However, its computation is challenging due to existing methods' high computational complexity and numerical instability. The restarted Heavy Ball Algorithm provides a streamlined and efficient approach for computing the square root matrix function. The approach demonstrates its effectiveness through numerical experiments on various matrices, showing its superior performance compared to existing state-of-the-art methods. Numerical results show that the restarted Heavy Ball algorithm is feasible and effective for calculating the square root function.