'Runtimewarning - invalid value

Im doing my physics project and I used the below given formula to get the result. From this result my task is to create a line curve. I am facing this runtime error even though my result is coming as required. Can someone explain why this error is occurring.

C:\Users\Parvathy\PycharmProjects\Hermite Polynomial\gaussianp03.py:59: RuntimeWarning: invalid value encountered in sqrt
return (np.sqrt(1 - q) / 2 * np.pi * np.sqrt(4 - (1 - q) * (x ** 2))) * nprod(lambda i: (1 - q ** (i + 1))*(((1 + q ** i) ** 2) - (1 - q)*(q ** i)*(x ** 2)), [0, 1000])


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source