I am converting the expression into a hassian matrix using sympy library function as below:
Q = hessian(expr,X)
This conversion takes couples of minutes and with larger expression its more than 10 to 20 mins.
Is there any way I can optimize it so that it take less execution time? Please suggest a method that takes less execution time!!