Quantum neural network for more than 2 modes

Hi, I am trying this tutorial for CV-QNN: https://strawberryfields.ai/photonics/demos/run_quantum_neural_network.html.

However, when I change the number of modes to 2 modes, the output cost and fidelity become nan.

Hi @namnguyen0510! This was a bug that was recently fixed by the team on the GitHub repo: https://github.com/XanaduAI/strawberryfields/pull/589

But good catch, it looks like the website still needs to be updated! In the meantime, you can try using the updated example file, https://github.com/XanaduAI/strawberryfields/blob/master/examples/quantum_neural_network.py directly from the GitHub repo :slight_smile:

Let me know if you have any other questions!

Hi, I tried the code but there is another bug:
TypeError: Engine() missing 1 required positional argument: ‘num_subsystems’

Hi @namnguyen0510 :slightly_smiling_face:

Which version of Strawberry Fields did the error arise with? The SF version can be checked for example by looking at the output of sf.about(), after the import strawberryfields as sf import statement.