# Conjugate transpose of noncommutative matrix multiplication

I have: $$p=iab$$ $$p,a,b$$ are operators. So in mathematica I am writing this as:

p=I*a**b


Conjugate of above is $$-iba$$ In mathematica I tried ConjugateTranspose, but not working on p to find it's conjugate transpose.

• NonCommutativeMultiply (i.e., **) has essentially no built-in meaning. You have to either give it that meaning or develop replacement rules for transforming expressions involving **. Alternatively, you might try the NCAlgebra package. Sep 7, 2021 at 22:23
• If I define conj[Ia_ ** b_] := -Ib ** a, This rule isn't working. Sep 8, 2021 at 3:49
• Jasmine, you’ll need to individually define all of your replacement rules. What you suggest is close, but still not sufficient. Check the documentation of NonCommutativeMultiply for some hints on how to do this. Also I recommend you search the function name on this SE for related questions (they do exist). Sep 8, 2021 at 14:57
• @Jasmine. That rule works just fine. I suspect you didn't leave a space between the I and a on the left-hand side and the I and the b on the right-hand side. An alternative thing to do (which is what I do when doing these kinds of calculations), is to define replacement rules instead. I.e., make a list of things like conj[I a_**b_] :> -I b**a and then using ReplaceAll (/.) to transform the expressions. Sep 8, 2021 at 21:58
• Here are some ideas for how to go about doing this. You can ignore the first part about the basis elements if you want (unless you're actually doing geometric algebra!), but the set of rules later for implementing linearity and such might be useful. Sep 8, 2021 at 22:17

aj[I a ** b]