An extremely important option for NCProcess is NCCollectOnVars. In addition to being an option, it can be called as a stand-alone command.
In the example
In[2]:= SetKnowns[A,B];
In[3]:= SetUnknowns[X,Y,Z]; In[4]:= NCCollectOnVars[X**A**B**Z + Y**A**B**Z + A**X+A**Y,{A,B}] Out[4] := (X+Y)**A**B**Z + A**(X+Y) |
Another example is if A,Tp[A], B1, Tp[B1] B2, Tp[B2] C1, Tp[C1] C2 and Tp[C2] are knowns and all other variables are unknowns, then:
In[2] := long = E21 ** A ** iE21 ** E22 - E21 ** B1 ** Tp[B1] ** E12 +
> E21 ** B2 ** Tp[B2] ** E12 + E22 ** iE12 ** Tp[A] ** E12 - > E21 ** B2 ** C1 ** iE21 ** E22 - > E22 ** iE12 ** Tp[C1] ** Tp[B2] ** E12 + > E21 ** B1 ** Tp[B1] ** E11 ** iE21 ** E22 - > E21 ** B2 ** Tp[B2] ** E11 ** iE21 ** E22 - > E22 ** iE12 ** E11 ** A ** iE21 ** E22 + > E22 ** iE12 ** E11 ** B1 ** Tp[B1] ** E12 - > E22 ** iE12 ** E11 ** B2 ** Tp[B2] ** E12 - > E22 ** iE12 ** Tp[A] ** E11 ** iE21 ** E22 + > E22 ** iE12 ** E11 ** B2 ** C1 ** iE21 ** E22 + > E22 ** iE12 ** Tp[C1] ** Tp[B2] ** E11 ** iE21 ** E22 - > E22 ** iE12 ** E11 ** B1 ** Tp[B1] ** E11 ** iE21 ** E22 + > E22 ** iE12 ** E11 ** B2 ** Tp[B2] ** E11 ** iE21 ** E22 In[3] := NCCollectOnVariables[long] Out[3]:= E22 ** iE12 ** Tp[A] ** (E12 - E11 ** iE21 ** E22) + > (E21 - E22 ** iE12 ** E11) ** A ** iE21 ** E22 - > (E21 - E22 ** iE12 ** E11) ** B1 ** Tp[B1] ** > (E12 - E11 ** iE21 ** E22) + > (E21 - E22 ** iE12 ** E11) ** B2 ** Tp[B2] ** > (E12 - E11 ** iE21 ** E22) - > E22 ** iE12 ** Tp[C1] ** Tp[B2] ** (E12 - E11 ** iE21 ** E22) - > (E21 - E22 ** iE12 ** E11) ** B2 ** C1 ** iE21 ** E22 |
This prints out a list containing two lists
E22 ** iE12,
> (E21 - E22 ** iE12 ** E11), > -(E21 - E22 ** iE12 ** E11), > (E12 - E11 ** iE21 ** E22), > (E21 - E22 ** iE12 ** E11), > (E12 - E11 ** iE21 ** E22), > -E22 ** iE12, > -(E21 - E22 ** iE12 ** E11) |
and the list of right sides is
{
(E12 - E11 ** iE21 ** E22), iE21 ** E22, -(E12 - E11 ** iE21 ** E22), (E12 - E11 ** iE21 ** E22), - (E12 - E11 ** iE21 ** E22), - iE21 ** E22 } |
If the NCProcess option NCCV → True is set NCProcess will perform the sort of collection described in Section 19.2. Specifically, NCCollectOnVars[ OutputofGroebnerBasisAlgorithms, KnownIndeterminates ] is called before the result is output to LATEX. This has been shown to be useful in the discovery of “motivated unknowns” as discussed in [HS].