I'm trying to use NCAlgebra to simplify some expressions and I'm having trouble with simplifying conjugates. Let's say I have two variables $a, b$ and a third variable $c$ which I want to conjugate with. We know $$c(ab)c^{-1} = (cac^{-1})(cbc^{-1})$$ so that if say $cac^{-1} = a$ and $cbc^{-1} = a^{-1}$ then we expect $c(ab)c^{-1} = 1$.

I've looked into the documentation and I can't seem to find a way to tell NCAlgebra to simplify (if possible) using this identity. I've tried to add an explicit rule and a more general replacement rule. The expressions I'm interested in are more complicated but I can't get a working example even in this simple case. Even when I explicit give it a rule it doesn't work:

SetNonCommutative[a, b, c];
NCReplaceRepeated[c ** (a ** b) ** inv[c],
 {c ** a ** inv[c] -> a,
  c ** b ** inv[c] -> inv[a],
  c ** x_ ** y_ ** inv[c] -> (c ** x ** inv[c]) ** (c ** y ** inv[c]),
  c ** (a ** b) ** 
    inv[c] -> (c ** a ** inv[c]) ** (c ** b ** inv[c])}]

In short I would like NCAlgebra to try and use the fact that $c(ab)c^{-1} = (cac^{-1})(cbc^{-1})$ in order to look for simplifications. In some expressions this might not lead to a useful simplification (in which case $c(xy)c^{-1}$ is the simplest form period) but I would like for NCAlgebra to try and look as far as possible.

  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Commented Feb 24, 2022 at 14:19

1 Answer 1


The problem here is that the two relations $c^{} a^{} c^{−1} = a$ and $c^{} b^{} c^{−1} = a^{−1}$ actually imply $a b = b a = 1$ (just multiply the left hand sides of the expressions) so the rules you are looking for in your substitution are really those two.

If you are interested in automatically discovering such rules then take a look at the Groebner basis algorithm in NCAlgebra. For example, in your case, running

SetMonomialOrder[b, a, inv[a], c, inv[c]];
rels = {c ** a ** inv[c] - a, c ** b ** inv[c] - inv[a]};
rules = NCMakeGB[rels, 10]

would produce the set of rules

{inv[c] ** a -> a ** inv[c], c ** a -> a ** c, a ** b -> 1, b ** a -> 1, inv[a] -> b, inv[c] ** b -> b ** inv[c], c ** b -> b ** c}

in which the $a b = b a = 1$ rules have been now discovered starting from your original relations.

  • $\begingroup$ Firstly, thanks for writing the module and introducing me to this method. I think this more or less fixes some of the issues I've been encountering and I can look into it more. I actually tested this with another problem I had involving NCReplaceRepeated using the first rule in the list, even if it gave a "worse" simplification. (e.g. with the rules {ab -> inv[c]} and {bc -> d} for instance, NCReplaceRepeated[abc, rules] depended on which rule came first.) Would you say using the GB method is the correct way/best practice for simplifying polynomial expressions? $\endgroup$
    – double111
    Commented Feb 24, 2022 at 23:45
  • $\begingroup$ As you noticed, things are very dependent on the order in which the simplification rules are applied. The gb formalism lets you set an ordering which roughly amounts to controlling what symbol do you care more in your relations. This might capture enough of what you are trying to do to be helpful. You might also want to take a look at NCSymplifyRational. $\endgroup$ Commented Feb 25, 2022 at 2:31

Your Answer

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

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