3
$\begingroup$

This question already has an answer here:

I am interested in solving a sparse complex linear system Ax=b where A is a square matrix of complex numbers and b is vector of complex numbers.

If possible I would like such a library to be templated (for the ease of installation and use) sth in the spirit of Eigen

I checked out Eigen but it does not, I think, look like it supports solving linear equations with complex sparse matrices, (although one can create and do elementary operations on complex matrices.)

Another trick someone suggested to me was one can work around this, by solving an extended system of twice the dimension using the fact that (A1 + iA2)(x1 + ix2) = (b1 + ib2) but I would prefer some simple black box which gets the job done.

Any suggestions?

$\endgroup$

marked as duplicate by GertVdE, Brian Borchers, hardmath, aeismail, Max Hutchinson Jan 7 '14 at 17:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

You can do it by transforming that system to equivalent real one and then use usual real solver.

There is a Trilinos package called Komplex which does precisely that, you may find it here

Also look for the paper: D. Day, M.A. Heroux - Solving Complex-Valued Linear Systems via Equiavalent Real Transformations, SIAM J. Sci. Comput, Vol.23, No.2, 2001.

$\endgroup$
  • 1
    $\begingroup$ Another option could be to use Belos with Tpetra templated with the complex scalar parameter. $\endgroup$ – Algebraic Pavel Dec 20 '13 at 18:23
2
$\begingroup$

I think Eigen can do it, but also check out UMFPACK which is written in C. Eigen has templated C++ wrappers for UMFPACK. Also see the book on templates for solving linear systems and the survey of linear algebra libraries.

$\endgroup$
1
$\begingroup$

Elemental (written in C++11) and PETSc (written in C, interfaces with UMFPACK, Elemental, and other linear algebra packages) can both solve systems of linear equations over the field of complex numbers. PETSc is geared more towards sparse linear algebra and has some dense linear algebra capabilities as well.

$\endgroup$

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