Hey @Pablo_Vinas! Yep, I do recommend introducing another library to integrate with your `pennylane-sf`

code, be it Tensorflow, PyTorch, etc. Personally, I prefer PyTorch. Here’s an example of using the `strawberryfields.fock`

device with the PyTorch interface:

```
import pennylane as qml
import torch
dev = qml.device("strawberryfields.fock", wires=3, cutoff_dim=3)
@qml.qnode(dev, interface="torch")
def quantum_function(x, theta):
qml.Displacement(x, 0, wires=0)
qml.Beamsplitter(theta, 0, wires=[0, 1])
return qml.expval(qml.NumberOperator(0))
# To use a GPU here, change 'cpu' to 'cuda'
x = torch.tensor(0.1, device='cpu', requires_grad=True)
theta = torch.tensor(0.1, device='cpu', requires_grad=True)
opt = torch.optim.Adam([x, theta], lr=0.1)
for _ in range(10):
opt.zero_grad()
loss = quantum_function(x, theta)
loss.backward()
opt.step()
print(quantum_function(x, theta))
'''
tensor(2.1328e-16, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0042, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0052, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0024, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0003, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0002, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0011, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0017, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0016, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
tensor(0.0010, dtype=torch.float64, grad_fn=<SqueezeBackward0>)
'''
```

Hope this helps!