I saw under http://docs.sympy.org/dev/tutorial/simplification.html#powsimp
that it is impossible to combine radicals using powersimp:
"This means that it will be impossible to undo this identity with powsimp(),
because even if powsimp() were to put the bases together, they would be
automatically split apart again."
I was wondering if it was possible to do this any other way.
For a toy example I have
import sympy
L = sympy.symbols('L', real=True, finite=True, positive=True)
sympy.sqrt(L) * sympy.sqrt(pi)
and I would like to have it return sympy.sqrt(L * pi)
Is there any way to do this?
What I'd really like is if it combined these terms in this real example:
import simplify
import vtool as vt
import sympy
sigma, dist, L = sympy.symbols('sigma, distij, L', real=True,
finite=True, positive=True)
kernel = (1 / sympy.sqrt(sigma ** 2 * 2 * sympy.pi)) *
sympy.exp((-dist ** 2) / (2 * sigma ** 2))
phi = (1 / L) * kernel
logphi = sympy.simplify(sympy.log(phi))
logphi = sympy.logcombine(logphi)
So I would get
-distij**2/(2*sigma**2) - log(sqrt(2 * pi)*L*sigma)
instead of
-distij**2/(2*sigma**2) - log(sqrt(2)*sqrt(pi)*L*sigma)
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/c2d73b5e-60d0-4140-af8e-033ec7234890%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.