# Resolvent operator with FF/PETSc (MatMatSolve?)

**URL:** <https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603>\
**Category:** General Discussion\
**Created:** [March 16, 2022, 4:05pm UTC](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603 "2022-03-16T16:05:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [March 16, 2022, 4:05pm UTC](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603/1 "2022-03-16T16:05:45Z")

</div>

Hello FF developers,

I am interested in implementing a resolvent (input/output) analysis framework using the FreeFEM/PETSc interface.

To do this, I need to construct a matrix that is defined by a series of products and of several sparse matrices and matrix inverses. The matrix of interest is Hermitian, with a dimension of n\times n. It is defined as L=B^HR^HM\_qRB.

Here, B is a m\times n matrix of 1s and 0s with m\geq n, M\_q is a positive semi-definite m\times m matrix, and R is an m\times m matrix defined by an inverse as R=(i\omega M\_q+J)^{-1}.

With the exception of R, I can construct the `Mat` objects for each of the basic components of L, and I understand how to perform the necessary `MatMatMult()` operations. However, I do not know how to use MUMPS to find R. It seems like this would require the `MatMatSolve()`, but I couldn’t find any documentation on this in FreeFEM. Has anyone encountered a similar problem and found a solution?

For context, I need to construct this matrix in order to solve the eigenvalue problem (using the SLEPc interface):

L\tilde{\mathbf{f}}=\lambda M\_f\tilde{\mathbf{f}}, where M\_f is a positive definite n\times n matrix.

A good overview with more detail on this subject is given [here](https://hal.archives-ouvertes.fr/hal-00756811/document) (see Section 4).

---

_[View the full topic](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603)._
