help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in Calc? (was Re: Non-commutative symbolic multiplication in Calc)


From: Neon Absentius
Subject: Bug in Calc? (was Re: Non-commutative symbolic multiplication in Calc)
Date: Tue, 6 Sep 2005 21:33:48 +0000
User-agent: Mutt/1.4.2.1i

On Tue, Sep 06, 2005 at 03:03:30PM -0500, Jay Belanger wrote:
> 
> Neon Absentius <absent@sdf.lonestar.org> writes:
> 
> > Sorry if this is not the right list for this question. 
> >
> > Is there a way to suspend some of the automatic simplifications that
> > calc performs? In particular I am interested in suspending the
> > assumption that multiplication is commutative.
> 
> Does matrix mode ("m v") do what you want?

Yes and no!

I mean if it would do what the info describes I would be happy. 
I don't think that the assumption all variables are matrices 
really says much more than "distinct variables do not necessarily
commute", so that would be exactly what I was looking for. Alas
there seems to be a bug: After I give 'm v' if I ask calc to
simplify the expression 'a b - b a' it leaves it as is which is as 
expected. However when I ask it to expand '(a+b)^2' it returns 
'a^2 + 2 b a + b^2' which is of course wrong if a and b don't commute. 
This happens both with emacs-multi-tty (22.0.50) and whith emacs
21.4.1 on a Debian testing/unstable. The bug manifsts itself also
for the expansion of '(a+b)^3' however calc expands '(x+y)(x-y)'
into 'x^2 + y x  -  x y + y^2'. Strange!

I attach the "Trail buffer" 

,----
| Emacs Calculator v2.1 by Dave Gillespie
|      1
| alg' (x + y)^2
| simp (x + y)^2
| simp (x + y)^2
| expa x^2 + 2 * y * x + y^2
| derv 2 * x + 2 * y
| alg' (a + b)^2
| expa a^2 + 2 * b * a + b^2
| alg' (a + b)^2
| expa a^2 + 2 * b * a + b^2
| alg' (b + a)^2
| expa b^2 + 2 * a * b + a^2
| alg' a
| alg' b
| alg' b
| aprt b
| alg' a
|    * b * a
|      3
| alg' a
|    * b * a
|    * a * b
|    - b * a - a * b
| simp b * a - a * b
| simp b * a - a * b
| alg' (b + a)^2
| expa b^2 + 2 * a * b + a^2
| alg' (a + b)^3
| expa a^3 + 3 * b * a^2 + 3 * b^2 * a + b^3
| alg' (x - y) * (x + y)
| expa x^2 + x * y - y * x - y^2
| alg' (a - b) * (b + a)
| expa a * b + a^2 - b^2 - b * a
| alg' a * b
| alg' b * a
|    + a * b + b * a
`----

-- 
Most precious among the relics remaining of Peter's skeleton in the
Vatican are 29 fragments of one of his skulls. (St. Peter's other
skull is preserved in a reliquary at the Cathedral of St. John
Lateran.)
   -- Frank R. Zindler, "Of Bones and Boners"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]