My goal is to do symbolic calculations in the noncommutative associative algebra generated by two elements $x,y$ satisfying the relation $x.y=q~y.x$. This infinite dimensional algebra has the basis $X_{i,j}=x^i y^j$ with multiplication rules $$X_{i,j}.X_{k,l}=q^{-jk}X_{i+k,j+l}.\tag{1}$$ I want to realize this multiplication rule as a function $m[A,B]$ where both $A$ and $B$ are (finite) linear combinations of $X_{i,j}$s and the output should also be linear combination of $X_{i,j}$s. How to do this in Mathematica?

  • 1
    $\begingroup$ Perhaps 20435 would be of some interest. $\endgroup$
    – Syed
    Sep 4 at 18:38
  • 1
    $\begingroup$ Nothing in the current version supports this. Unless you find a package on the web, or someone willing to volunteer their time, you'll need to write this yourself. Start by writing down a detailed list of rules your new objects follow, then use some of the methods in the previous comment to implement these rules. $\endgroup$
    – user87932
    Sep 4 at 18:55
  • $\begingroup$ See section "Some noncommutative algebraic manipulation" in this conference talk from 1998. In particular there is an implementation of commutators. $\endgroup$ Sep 5 at 23:51

2 Answers 2

        x[i_,j_]**x[k_,l_]:>q^(i k) x[i+k,j+l]

expr=NonCommutativeMultiply@@ConstantArray[(c1 x[a,b]+c2 x[c,d]),4]


enter image description here

  • $\begingroup$ Apart from a small typo in line 8 ($q^{i k}$ should actually be $q^{-jk}$), this solution works. $\endgroup$
    – Lagrenge
    Sep 5 at 19:05

A rather easy way of implementation is to use one of the different undefined product functions like CenterDot, CircleDot as containers and implement the axioms by patterns. This is just a proposal to be tested for functioning. Since TensorExpand does not work on CenterDot as with containers TensorProduct and Wedge, it has to be implemented explicitely.

   X/:  VectorQ[Subscript[X,_,_]]:=True

     QScalarQ[x__]:= FreeQ[Times[x],Subscript[X,_,_]]
(*CenterDot as the algebra defining TensorProduct *)  

     QExpand={  CenterDot[a___,Subscript[X,i_,j_],Subscript[X,m_,n_],b___]] :>
                Exp[- q j m]*CenterDot[a___,Subscript[X,i+m,j+n] ,b]  ,
    (*The other rules are multilinearity with repect to + and scalar Times  *)
      (* Multilinearity for Plus  *)
      CenterDot[a___,b_Plus,c___]] :> (CenterDot[a,#_,c]&)/@b  ,
      (*  Scalar Times multilinearity *)
         CenterDot[a___,p__?QScalarQ *  Subscript[X,i_,j_] ,b___]] :> 
          Times[p]* CenterDot[a,Subscript[X,i,j] ,b]    }
        CenterDot[] :=1

Use it by

expr //.QExpand

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.