This code gives sqrt(a^2), I need it to give abs(a).
from sympy import sqrt, simplify, symbols
from sympy.parsing.sympy_parser import parse_expr
a = symbols('a', real=True)
expr = parse_expr('a**2')
sqrt(simplify(expr)).simplify()
from sympy import sqrt, simplify, symbols
a = symbols('a', real=True)
expr = eval('a**2')
sqrt(simplify(expr)).simplify()