# Complex support in dolfin

**URL:** <https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189>\
**Category:** Uncategorized\
**Created:** [May 12, 2020, 10:56pm UTC](https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189 "2020-05-12T22:56:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkum9](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@mkum9](https://fenicsproject.discourse.group/u/mkum9)\
**Post date:** [May 12, 2020, 10:56pm UTC](https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189/1 "2020-05-12T22:56:00Z")

</div>

Hello!

I’m trying to solve a generalized eigenvalue problem by specifying complex values of shift for the shift-invert algorithm. My matrices A and B are real.

Does any version of dolfin (not dolfinx) currently support complex shifts to the SLEPcEigensolver object? I see that complex support is possible according to [https://fenicsproject.org/fenics-project-roadmap-2019/](https://fenicsproject.org/fenics-project-roadmap-2019/)  
, is this a reference to dolfinx?

Given that A and B are real themselves, if dolfin can be built from source against complex PETSc this should solve the problem right?

Thanks!

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [May 13, 2020, 9:54am UTC](https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189/2 "2020-05-13T09:54:01Z")

</div>

There is a bit of discussion on this question at [Solving complex-valued PDE](https://fenicsproject.discourse.group/t/solving-complex-valued-pde/806)

---

<div class="post-metadata">

**Author:** ![mkum9](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@mkum9](https://fenicsproject.discourse.group/u/mkum9)\
**Post date:** [May 14, 2020, 12:49am UTC](https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189/3 "2020-05-14T00:49:42Z")

</div>

Thanks, I did see that but that talks more about splitting the problem into real and imaginary parts. My question is more about applying a complex shift to real matrices A and B in the eigenvalue problem.

The SLEPcEigensolver object is just a wrapper around the PETSc EPS object which can support complex shifts if built against complex PETSc right?

Is it at all possible to build dolfin against complex PETSc? I dont want to solve the complex GEVP just apply a complex shift.

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [May 14, 2020, 2:07am UTC](https://fenicsproject.discourse.group/t/complex-support-in-dolfin/3189/4 "2020-05-14T02:07:24Z")

</div>

As discussed in that thread, you’ll need dolfinx if you want complex number support in the software.
