Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bosonic backend - backend.py and states.py (#539)
* Adds __init__ and backend.py for bosonic backend - Contains all the gaussian methods for the bosonic backend Co-Authored-By: ilan-tz <57886357+ilan-tz@users.noreply.github.com> Co-Authored-By: Nicolas Quesada <991946+nquesada@users.noreply.github.com> Co-Authored-By: GDauphinais <48553380+GDauphinais@users.noreply.github.com> * Modifies the backend __init__ and base.py files - Includes BaseBosonic object - Includes references to bosonic backend in init file Co-Authored-By: ilan-tz <57886357+ilan-tz@users.noreply.github.com> Co-Authored-By: Nicolas Quesada <991946+nquesada@users.noreply.github.com> * Update states.py file Adds BaseBosonicState and its tailored methods Co-Authored-By: ilan-tz <57886357+ilan-tz@users.noreply.github.com> Co-Authored-By: Nicolas Quesada <991946+nquesada@users.noreply.github.com> * Updates conftest.py Adds bosonic backend to backends for testing Co-Authored-By: ilan-tz <57886357+ilan-tz@users.noreply.github.com> * Tests for bosonic backend - Adds/removes bosonic marking to/from some existing tests - New tests for gaussian_cptp, mbsqueezing, and BaseBosonicState methods * Tidying code based on codefactor * More codefactor tidying * More codefactor * ran black * Mark integration tests so that they don't apply to the bosonic backend yet. We will mark them for the bosonic backend once the PR with the bosonic engine is added. * Ensure peaks in add_mode are integers * Apply suggestions from code review Mostly minor docstring/formatting edits Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: Nicolas Quesada <zeitus@gmail.com> * Update BaseBosonic inheritance Now inherits from BaseGaussian Co-Authored-By: Josh Izaac <josh@iza.ac> * Update strawberryfields/backends/base.py Co-authored-by: antalszava <antalszava@gmail.com> * Adding reference to bosonic in docstrings * Applies Antal and Theo's suggestions - Tidies or simply deletes inheritable docstrings - Changes is_vacuum method * Ran black * Minor changes - Add back in state method for BaseBosonic since the output is different than BaseGaussian - Add shortcut to BosonicModes for fidelity_coherent if all modes have been deleted - Tidy docstring of state purity function * Ran black * Tidying code + test - wrote new test that checks fidelity_vacuum in states.py, since the is_vacuum method of the backend changed, and consequently this was no longer being tested * Apply suggestions from code review Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Theodor <theodor@xanadu.ai> * ran black * Apply suggestions from code review * Fix photon number variance for non-gaussian states * Deletes TODO note * Apply suggestions from code review Co-authored-by: antalszava <antalszava@gmail.com> * Ran black * Tidying docstrings * Breaks the test test_multimode_gaussian_random_state Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com> Co-authored-by: Nicolas Quesada <991946+nquesada@users.noreply.github.com> Co-authored-by: GDauphinais <48553380+GDauphinais@users.noreply.github.com> Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: Nicolas Quesada <zeitus@gmail.com> Co-authored-by: Josh Izaac <josh@iza.ac> Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Theodor <theodor@xanadu.ai>
- Loading branch information