The following is an example of the above command.
In[22]:= expr = x ** z ** x ** w + x ** z ** y ** w + z ** x ** x ** w +
z ** x ** y ** w; In[23]:= NCTermArray[expr,{x,y},foo] Out[23]= foo In[24]:= ??foo Global‘foo foo["types"] = {{1, 1}, {2, 0}} foo["variables"] := {x, y} foo[x, y] = x ** z ** y ** w + z ** x ** y ** w foo[x ** x, 1] = x ** z ** x ** w + z ** x ** x ** w foo[x___] := 0 |
If we continue with the example above we have the following
In[24]:= NCReconstructFromTermArray[foo]
Out[24]= x ** z ** x ** w + x ** z ** y ** w + z ** x ** x ** w + > z ** x ** y ** w |
However, now one can also do some manipulation before reconstructing as shown below.
In[25]:= foo[x,y] = NCC[foo[x,y],y**w]
Out[25]= (x ** z + z ** x) ** y ** w In[26]:= foo[x**x,1] = NCC[foo[x**x,1],x**w] Out[26]= (x ** z + z ** x) ** x ** w In[27]:= ??foo Global‘foo foo["types"] = {{1, 1}, {2, 0}} foo["variables"] := {x, y} foo[x, y] = NCC[x ** z ** y ** w + z ** x ** y ** w, y ** w] foo[x ** x, 1] = NCC[x ** z ** x ** w + z ** x ** x ** w, x ** w] foo[x___] := 0 In[27]:= NCReconstructFromTermArray[foo] Out[27]= (x ** z + z ** x) ** x ** w + (x ** z + z ** x) ** y ** w |