Kerr layers in QONN

Optimizing a quantum optical neural network

If I delete the sentence:

    for i in wires:
        qml.Kerr(phi_nonlinear, wires=i)

Then the gradient-based method will not working.
If I choose the parameter phi_nonlinear to be 0, the optimization will stop when loss=0.25. Why this happens?

Hi @Hamitonian!

The paper that tutorial is based on,, includes non-linear Kerr gates as part of the quantum optical neural network.

Without the Kerr operations, the circuit will be purely Gaussian, and therefore will be unable to fully produce the non-Gaussian target state! This is probably why the cost function is unable to be minimized beyond 0.25.

@theodor might be able to provide more details :slight_smile:


Hi @Hamitonian,

As @josh mentioned, the Kerr operations are required for the circuit not to be purely Gaussian. There need to be some kind of non-linear component that makes the transformation from the input states to the target states possible. Setting phi_nonlinear to 0 will remove this non-linearity, and thus the network cannot train.

I’m not actually sure why it stops working when removing the Kerr operations completely. It seems like Nlopt isn’t able to optimize the circuit at all, and it simply gets stuck somehow. :thinking:

Thank you for your generous help!

1 Like

Thanks @Hamitonian, let us know if you have any further questions!