# Complex matrixes

**URL:** <https://root-forum.cern.ch/t/complex-matrixes/64189>\
**Category:** Newbie\
**Tags:** root\
**Created:** [September 22, 2025, 7:32am UTC](https://root-forum.cern.ch/t/complex-matrixes/64189 "2025-09-22T07:32:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_Lopez](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rafa_lopez/32/39392_2.png) [@Rafa\_Lopez](https://root-forum.cern.ch/u/Rafa_Lopez)\
**Post date:** [September 22, 2025, 7:32am UTC](https://root-forum.cern.ch/t/complex-matrixes/64189/1 "2025-09-22T07:32:39Z")

</div>

Hello, I have been trying for the last week to work with complex matrixes in ROOT(C++). Is there a way to work with them? I was trying to invert a matrix and do a couple of calculations but TMatrixD or TMatrixT do not allow complex numbers, only doubles or floats right?  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [September 22, 2025, 7:46am UTC](https://root-forum.cern.ch/t/complex-matrixes/64189/2 "2025-09-22T07:46:32Z")

</div>

Hello @Rafa_Lopez,

while you could instantiate the template TMatrixT with complex numbers, you might get stuck when it uses functions that haven’t been overloaded for these types. Also, it wouldn’t exploit any knowledge about complex matrices to speed up certain algorithms.

Therefore, I would recommend the GNU Scientific Library like in [this post](https://root-forum.cern.ch/t/finding-eigenvalues-and-eigenvectors-of-a-complex-matrix/18646)

The more up-to-date link is now:

> **[Eigensystems — GSL 2.8 documentation](https://www.gnu.org/software/gsl/doc/html/eigen.html)**
