I want to invert a matrix, {{a,b},{c,d}}, where a,b,c,d are elements of a non-commutative field (for example invertible matrices). However when I use the function Inverse, it outputs elements as $\dfrac{d}{da-bc}$, while I actually need $(da-bc)^{-1} d$.

Is there a way to specify in Mathematica that a,b,c,d should be treated as elements of a non-commutative field?

  • $\begingroup$ I think you'll have to write your own NoncommutativeInverse function. $\endgroup$
    – QuantumDot
    Commented Sep 22, 2016 at 12:34

1 Answer 1


The package NCAlgebra does exactly what you are looking for.


NCInverse[{{a, b}, {c, d}}] // MatrixForm

Result matrix


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.