MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

overloading times operator

  • To: mathgroup at
  • Subject: [mg88820] overloading times operator
  • From: gstaples <gstaceystaples at>
  • Date: Sat, 17 May 2008 05:32:08 -0400 (EDT)

I wrote a procedure to define the non-commutative product of two elements of the form e_X e_Y, where X and Y are multi-indices.  I do this using Times.

I do a simple calculation like
Expand[(e_{1} + e_{3})(e_{1} - e_{3})]

and get the wrong answer.  (On the first try.)

If I then re-execute the code that defines the multiplication, I repeat the calculation and get correct output.

Alternatively, if I execute


before loading the procedure, I get correct output on the first try.  

More troubling is that after getting correct output, if I perform calculations of a different kind (e.g. matrix multiplication), when I repeat my original calculation, I start getting incorrect output again.  (Until I re-execute the code that defines the multiplication.)

It's frustrating to repeat a calculation and get different sets of output depending on what other calculations are done in between.

Does anyone have suggestions?

  • Prev by Date: Re: Replace non-numeric values in a list
  • Next by Date: Re: DSolve question
  • Previous by thread: Re: Applying the Integration Function to a List Of
  • Next by thread: Re: overloading times operator