# NCAlgebra square of commuting variable

I use the NCAlgebra Package. Now when I enter the square(so standard product) of a noncommuting variable Mathematica returns the variable with NonCommutativeMultiply:

p*p


returns

p**p


Product of two different variables just returns as expected

a*b


returns

ab


Anyone can reproduce this? I don't think this can be the desired behavior?

@lennart this is the default behavior starting with version 5 of NCAlgebra. Mixing Times and ** is a source of much trouble as it can easily generate expressions that cannot be correctly interpreted. Think a**b * c when a, b and c are all noncommutative. So, after much debate, we decided to start overloading Power for noncommutative symbols. It is done with UpValues so it should not be too intrusive.
This was however not an easy decision. Canonizing expressions is a much needed step in any symbolic computation and this is exactly why MMA also canonizes Times[p, p] as Power[p,2]! However, as you noticed, a * b is still Times[a, b]! Indeed, it is not possible to easily overload Times without been too intrusive. Think Times[b, a] that gets alphabetized as Times[a, b] before any rule can be applied. As a compromise we have introduced the command NCConsistentQ that will return True is an expression is a consistent NC expression.
• Probably safer to leave both Times and Power alone, and document that Times should only be used with quantities that commute (or better, only use it when there are two operands, one of which is a scalar that commutes with everything). Dec 16 '18 at 15:43