# QSVT in Pennylane

**URL:** <https://discuss.pennylane.ai/t/qsvt-in-pennylane/8347>\
**Category:** Demos\
**Created:** [April 1, 2025, 8:08am UTC](https://discuss.pennylane.ai/t/qsvt-in-pennylane/8347 "2025-04-01T08:08:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AleZecchi94](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@AleZecchi94](https://discuss.pennylane.ai/u/AleZecchi94)\
**Post date:** [April 1, 2025, 8:08am UTC](https://discuss.pennylane.ai/t/qsvt-in-pennylane/8347/1 "2025-04-01T08:08:23Z")

</div>

Dear Pennylane Forum,

I’m a PhD student in Mathematical Engineering and I am studying QSVT for a research project.

I have read the article about it, but I would like to ask you a few questions about the code for implementing the algorithm.

More precisely:

1. Why does the formula used for QSVT in pennylane ([qml.QSVT — PennyLane 0.40.0 documentation](https://docs.pennylane.ai/en/stable/code/api/pennylane.QSVT.html)) is different from the one defined in the paper a Grand Unification of Quantum Algorithms? In particular it has one more “phase” term.

2. Why in pennylane do I need to specify the block encoding technique when I use qml.qsvt?

3. QSVT should be able to work properly also when the input matrix isn’t Hermitian, but in one of your demos ([QSVT in Practice | PennyLane Demos](https://pennylane.ai/qml/demos/tutorial_apply_qsvt)) the matrix used for inversion is symmetric. Is pennylane compatible only with Hermitian matrices?

Thanks in advance.

Best regards

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [April 1, 2025, 8:53pm UTC](https://discuss.pennylane.ai/t/qsvt-in-pennylane/8347/2 "2025-04-01T20:53:52Z")

</div>

Hi @AleZecchi94 ,

Welcome to the Forum!

You may already be aware of this but I want to clarify it just in case. We have something confusing which is that we have a [qml.qsvt](https://docs.pennylane.ai/en/stable/code/api/pennylane.qsvt.html) _function_ (lowercase) and a [qml.QSVT](https://docs.pennylane.ai/en/stable/code/api/pennylane.QSVT.html) _class_ (uppercase). So it’s good to make the distinction between both. In the [QSVT in Practice](https://pennylane.ai/qml/demos/tutorial_apply_qsvt) demo the QSVT _class_ is used, while the [Intro to QSVT demo](https://pennylane.ai/qml/demos/tutorial_intro_qsvt) uses the qsvt _function_.

Now regarding your questions:

1. I’m not sure, I’ll get back to you on this.
2. You need to specify it because you need to block-encode your matrix, so PennyLane needs to know what type of block encoding you want to use. Does this answer your question? Can you please rephrase your question in case this doesn’t answer it?
3. If you’re using the [qml.qsvt](https://docs.pennylane.ai/en/stable/code/api/pennylane.qsvt.html) _function_ then yes, it only works with Hermitian matrices.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![Guillermo\_Alonso](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/guillermo_alonso/32/816_2.png) [@Guillermo\_Alonso](https://discuss.pennylane.ai/u/Guillermo_Alonso)\
**Post date:** [April 1, 2025, 9:49pm UTC](https://discuss.pennylane.ai/t/qsvt-in-pennylane/8347/3 "2025-04-01T21:49:52Z")

</div>

Good questions @AleZecchi94 !

The way QSVT is implemented in PennyLane historically is starting from the QSP formulation. Specifically, QSVT is built from the reflection convention. As you can see in [Appendix A.2](https://arxiv.org/pdf/2105.02859), if that is the path you take, that extra rotation will appear at the end.

On the other hand, if I am not mistaken, the matrix must be hermitian but if it is not, you could do a “Hermitification”: the process by which you encode a non-Hermitian matrix into a larger one that is

I hope that helps! 😄
