Re: Overriding Power

*To*: mathgroup at smc.vnet.net*Subject*: [mg26836] Re: [mg26808] Overriding Power*From*: Daniel Lichtblau <danl at wolfram.com>*Date*: Thu, 25 Jan 2001 01:13:16 -0500 (EST)*References*: <200101240918.EAA03605@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Jeff Hersh wrote: > > Hello, > > I am working on a package that deals with non-communative multiplication > and I have run into a problem with the Power function. As we know > Power[a b,n] (where n is an integer) automatically gets converted to > Power[a,n] Power[b,n]. However, with non-communative multiplication (I > have removed the Orderless attribute from Times to make it > non-communative) this isn't valid. Is there any way I can stop > Mathematica from automatically doing this conversion? > > Jeff > -- > Jeffrey Hersh,PhD > > Remove the *NOSPAM* to reply. > > <insert amusing quote here> This is a known bug (I reported it in-house around four years ago). In[5]:= (a*b)^3 3 3 Out[5]= a b In some ways I am happy to see this bug remain alive. The reason is that, while it is well and good for us to pretend that ordered Times is fully supported, in actual fact this is essentially impossible to do. Changing attributes of low-level arithmetic functions is problematic, and the better we appear to support it, the more likely are users to encounter really unobvious problems. We generally advocate using e.g. NonCommutativeMultiply with rules attached to support scalar multiplication, powers, commutators, and whatever else is required for your particular needs. Daniel Lichtblau Wolfram Research

**References**:**Overriding Power***From:*Jeff Hersh <frumple*NOSPAM*@home.com>