# Fidelity Operation in Gaussian Backend

**URL:** <https://discuss.pennylane.ai/t/fidelity-operation-in-gaussian-backend/1524>\
**Category:** Strawberry Fields\
**Created:** [November 30, 2021, 3:48am UTC](https://discuss.pennylane.ai/t/fidelity-operation-in-gaussian-backend/1524 "2021-11-30T03:48:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_J\_Estrella](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/francisco_j_estrella/32/665_2.png) [@Francisco\_J\_Estrella](https://discuss.pennylane.ai/u/Francisco_J_Estrella)\
**Post date:** [November 30, 2021, 3:48am UTC](https://discuss.pennylane.ai/t/fidelity-operation-in-gaussian-backend/1524/1 "2021-11-30T03:48:33Z")

</div>

Hi,

I’d like to verify if the equation used to estimate fidelity in the gaussian backend is Eq. 80 in “Gaussian quantum information” attached below:

 ![Screenshot%20from%202021-11-29%2020-34-57](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/1X/2b2a06785b7d29cc50a632018453e79aba12de12.png) ,

where x\_i denotes the vector of means and **V\_i** denotes the covariance matrix in the gaussian states.

Thanks!

---

<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:** [December 1, 2021, 2:25pm UTC](https://discuss.pennylane.ai/t/fidelity-operation-in-gaussian-backend/1524/2 "2021-12-01T14:25:19Z")

</div>

Hi @Francisco_J_Estrella it seems that you’re right. I’m confirming with someone who worked a lot with this backend though. I hope to have an answer soon!

---

<div class="post-metadata">

**Author:** ![theodor](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/theodor/32/178_2.png) [@theodor](https://discuss.pennylane.ai/u/theodor)\
**Post date:** [December 2, 2021, 4:25pm UTC](https://discuss.pennylane.ai/t/fidelity-operation-in-gaussian-backend/1524/3 "2021-12-02T16:25:44Z")

</div>

Hi @Francisco_J_Estrella,

The equation that you posted should be the same as the one used to calculate the fidelity in the Gaussian backend. The function used to calculate it can be found [here](https://github.com/XanaduAI/thewalrus/blob/321b7d19585f0d04b35a0b78249bd41ac317afdb/thewalrus/quantum/gaussian_checks.py#L102), in a package called The Walrus. As stated in the docstring, it’s an implementation of the square of Eq. 96 in [‘Gaussian states and operations - a quick reference’, Brask](https://arxiv.org/abs/2102.05748).

Comparing Eq. 101 in Brask, for single mode Gaussian states, with Eq. 80 in [‘Gaussian Quantum Information’, Weedbrook, et al.](https://arxiv.org/abs/1110.3234), we should see (using some substitutions) that they are identical.

Let me know if this answers your question!
