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
754 stars 191 forks source link

[WIP] TF2 recursive gates #376

Closed ziofil closed 4 years ago

ziofil commented 4 years ago

Context: Implementing the recursive gates from thewalrus in the tfbackend.

Description of the Change: Now displacement_matrix, squeezer_matrix, beamsplitter_matrix and two_mode_squeezer_matrix call the compiled functions from thewalrus. Each comes with a custom gradient, as the functions from the walrus are like black boxes and cannot be differentiated.

Benefits: 10x-100x faster than previous implementation

Possible Drawbacks: This PR needs a breaking (but needed) change: the parameters need to be passed to the tfbackend in polar form.

Related GitHub Issues:

co9olguy commented 4 years ago

:fireworks:

ziofil commented 4 years ago

This branch has been merged into the branch for the other [WIP] PR on the polar parameters. Closing for now.