ddaigle321

10 Reputation

One Badge

1 years, 276 days

MaplePrimes Activity


These are questions asked by ddaigle321

Something really weird is going on when I build a MultiSet in two different ways, using the "+" operation.  The two constructions give the same MultiSet (since U=V), but in some mysterious way they are not really equal (since X=Y is false).  Does anyone know how to avoid this?  Should the "+" operator be avoided altogether?

There is more:  I tried saving the values of X and Y using the command:  save X, Y, "anomaly.m" 

When I tried reading it with the command:  read "anomaly.m"
I got the error message:  "Error, could not open `anomaly.m` for reading".

Thanks!
 

restart

 

U := MultiSet(3 = 1)+MultiSet(4 = 1)

module MultiSet () local instance, hash, generalized; option object; end module

(1)

V := MultiSet(3 = 1)+MultiSet(4 = 1)

module MultiSet () local instance, hash, generalized; option object; end module

(2)

evalb(U = V)

true

(3)

X := [2, 7, U]; Y := [2, 7, V]

[2, 7, module MultiSet () local instance, hash, generalized; option object; end module]

 

[2, 7, module MultiSet () local instance, hash, generalized; option object; end module]

(4)

evalb(X = Y)

false

(5)

seq(evalb(X[i] = Y[i]), i = 1 .. 3)

true, true, true

(6)

``


 

Download Anomaly.mw

I want to manipulate polynomials in two non-commuting variables, over the field of rational numbers.  I read some of the help concerning Ore algebras, and also some of the help concerning the Physics package (where there are non-commuting variables), but unfortunately I could not understand much of what I read!  For someone who is not a Maple virtuoso, is there a simple way to work with non-commutative polynomials?  

 
I also tried the “do-it-yourself” approach, i.e., defining a non-commutative multiplication via a neutral operator &*.  This time I had some success, but I ran into problems when I tried to extract the coefficient of a given monomial in a given polynomial.  In the file  NonCommutPolynomials.mw  you can see that the Maple command “coeff” gives me the correct answer only when the degree of the monomial is strictly greater than 1.  I have no idea how to extract the coefficient of x, or of y, or how to get the constant term of the polynomial — and extracting coefficients is something I need to do!
 
Thanks!
 
Page 1 of 1