Is there any built-in method in FEniCS legacy to calculate the inverse square root of FEniCS matrices?

Dear @Deep_Math,
This seems to be a continuation of How to compute the (-0.5) power of a matrix - #2 by Stein

where you haven’t answered the question provided by other users.

Secondly, you problem is not reproducible, as we don’t know the size of your matrix. Additionally, you haven’t provided the necessary definitions to execut you code.

Thirdly, I assume that there are ufl components within the matrix, such as spatial coordinates (which are symbolic entities, not numbers), and can thus not be inverted with scipy.

Note that for 2x2 and3x3 matrices there is a symbolical inverse in ufl, but you cannot take any power of a matrix in ufl (except 2).

What I think you could do in DOLFINx is to use the @a-latyshev external operator library (GitHub - a-latyshev/dolfinx-external-operator: Extension of DOLFINx implementing the concept of external operator ) to get a place to patch in the scipy fractional matrix implementation (which is based on: https://epubs.siam.org/doi/abs/10.1137/10081232X)