# SLEPc PEP request

**URL:** <https://community.freefem.org/t/slepc-pep-request/1130>\
**Category:** Feature Request\
**Created:** [August 2, 2021, 9:41am UTC](https://community.freefem.org/t/slepc-pep-request/1130 "2021-08-02T09:41:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 2, 2021, 9:41am UTC](https://community.freefem.org/t/slepc-pep-request/1130/1 "2021-08-02T09:41:24Z")

</div>

Hi!

I am interested in solving polynomial eigenvalue problems using parallel FreeFem. Could you please interface the SLEPc Polnynomial Eigenvalue Problem in the near future?

Thanks  
Andras

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [August 2, 2021, 9:59am UTC](https://community.freefem.org/t/slepc-pep-request/1130/2 "2021-08-02T09:59:52Z")

</div>

It’s already there, see [FreeFem-sources/SLEPc-code.hpp at develop · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/blob/develop/plugin/mpi/SLEPc-code.hpp#L588). Maybe it’s not handling the specific case you have in mind?

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 10, 2021, 7:53pm UTC](https://community.freefem.org/t/slepc-pep-request/1130/3 "2021-08-10T19:53:41Z")

</div>

Thanks for the info, I will try it out.

Does it work like  
` int PEPSolve(Mat[int], vectors = fespace<complex>[int], values = complex[int], sparams = string);`  
or like  
` int PEPSolve(Mat0, Mat1, vectors = fespace<complex>[int], values = complex[int], sparams = string);`  
i.e., does the function expect a Mat array, or multiple Mat-s like when solving a generalized eigenvalue problem? Or does the PEPSolve function work differently? I am sorry, but I am not a good programmer, and find the [SLEPc-code.hpp file](https://github.com/FreeFem/FreeFem-sources/blob/develop/plugin/mpi/SLEPc-code.hpp) confusing.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [August 10, 2021, 7:59pm UTC](https://community.freefem.org/t/slepc-pep-request/1130/4 "2021-08-10T19:59:04Z")

</div>

`int PEPSolve(Mat[int], vectors = fespace<complex>[int], values = complex[int], sparams = string);` is the way to go.

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 10, 2021, 8:11pm UTC](https://community.freefem.org/t/slepc-pep-request/1130/5 "2021-08-10T20:11:58Z")

</div>

Thanks, I will try it out!

---

<div class="post-metadata">

**Author:** ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)\
**Post date:** [August 13, 2021, 8:11am UTC](https://community.freefem.org/t/slepc-pep-request/1130/6 "2021-08-13T08:11:59Z")

</div>

Dear @prj ,

Thank you for the help, I managed to use the PEP solver for my problem and it work flawlessly.

I also made a small example demonstrating the usage of the PEP solver in [this](https://github.com/FreeFem/FreeFem-sources/pull/191/commits/33f326feac7ac873335382a19fd9c20d5bfb0f6f) commit.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [August 13, 2021, 8:17am UTC](https://community.freefem.org/t/slepc-pep-request/1130/7 "2021-08-13T08:17:54Z")

</div>

Wow, thank you very much for your contribution, let’s continue the discussion over at GitHub.
