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.
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: