XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
101 stars 55 forks source link

Fixed error in fidelity calculation #223

Closed ETucks closed 3 years ago

ETucks commented 3 years ago

Looking at the paper from which the fidelity calculation is derived (https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.115.260501), it can be seen that the code was missing a square root in the final step.

Before submitting

Please complete the following checklist when submitting a PR:

When all the above are checked, delete everything above the dashed line and fill in the pull request template.


Context:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

nquesada commented 3 years ago

Hi @Etucks --- Your fix seems to break a number of tests. In particular your PR breaks the tests test_fidelity_vac_to_displaced_squeezed and test_fidelity_squeezed_vacuum in test_quantum.py.

nquesada commented 3 years ago

This issue is addressed in https://github.com/XanaduAI/thewalrus/pull/226 . I will close this issue.