# Adding MatDiagonalSet, MatAXPY and MatAYPX

**URL:** <https://community.freefem.org/t/adding-matdiagonalset-mataxpy-and-mataypx/1345>\
**Category:** Feature Request\
**Created:** [November 22, 2021, 3:40pm UTC](https://community.freefem.org/t/adding-matdiagonalset-mataxpy-and-mataypx/1345 "2021-11-22T15:40:57Z")\
**Posts on this page:** 1\
**Showing post:** 33

<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:** [January 25, 2022, 6:20am UTC](https://community.freefem.org/t/adding-matdiagonalset-mataxpy-and-mataypx/1345/33 "2022-01-25T06:20:26Z")

</div>

> Not sure why, but setting only […]

The `st_` prefix is added when the `KSP` is created by SLEPc. If you create it yourself with `set(...)`, the option should not be prefixed, unless you add the flag `set(..., prefix = "st_")`.

> […] however, I prefer SLEPc to handle all that.

Would it be possible to ask you for a piece of code that calls `PEPSolve()` and where I could try the `-ksp_reuse_preconditioner` option? You can share that in private if it’s best for you.

> […] nonzero vectors, those are used as a guess […]

I’ve never seen tremendous improvements using this feature.

> How does this work - I am struggling to figure this out on my own.

Please see [Slepc ESPSetDeflationSpace function](https://community.freefem.org/t/slepc-espsetdeflationspace-function/508) andd let me know if you need more details.

---

_[View the full topic](https://community.freefem.org/t/adding-matdiagonalset-mataxpy-and-mataypx/1345)._
