XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
745 stars 187 forks source link

Native support in the Fock backends for the MZgate #610

Closed nquesada closed 2 years ago

nquesada commented 3 years ago

The MZgate is the natural gate to decompose an arbitrary linear optical interferometer into single- and two-mode passive gates. Currently, interferometers are decomposed into MZgates and Rgates and then internally the MZgate is decomposed into two BSgates and two more rotation gates, leading to an increase by a factor of two in terms of the number of two mode gates needed to decompose and apply a given interferometer, making the process potentially less than optimal.

With the recent addition (cf. https://github.com/XanaduAI/thewalrus/pull/256) of the Fock representation of the MZgate and its gradient in the fock_gradients module of the development version of The Walrus it becomes possible to apply this gate directly in the Fock backends.

To implement these changes one needs to:

It would also be nice to have some benchmarking for a few modes studying any possible efficiency benefits when this gate is implemented natively.