logs automatically simplify perfect powers. To create a log that doesn't do
this you can use evaluate=False:

>>> log(4,evaluate=False)
log(4)

To do this to an entire expression you can do

>>> def logjoin(m):
...  if not m.is_Mul: return m
...  c, args = m.as_coeff_mul()
...  if c is S.One: return m
...  logs = [l for l in args if l.func is log and l.args[0].is_Number]
...  if len(logs) != 1: return m
...  args = list(args)
...  args.remove(logs[0])
...  return log(logs[0].args[0]**c, evaluate=False)*Mul._from_args(args)
...
>>> from sympy.simplify.simplify import bottom_up
>>> log(16)+log(9)
2*log(3) + 4*log(2)
>>> bottom_up(_, logjoin)
log(9) + log(16)

-- 
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to