Hello everyone I would like to train a CV quantum circuit. But I am receiving error with my code, can you help?
I have used StrawberryFields before and trying to combine these tutorials:
This is the code
dev = qml.device("default.gaussian", wires=1) @qml.qnode(dev) def mean_photon(mag_alpha, phase_alpha, phi): qml.Displacement(mag_alpha, phase_alpha) | wires = 0 qml.RX(phi) | wires = 0 qml.Kerr(phi) | wires = 0 return qml.expval(qml.NumberOperator(0)) def cost(params): return (mean_photon(params, params, params) - 1.0) ** 2 init_params = [0.015, 0.02, 0.005] qml.grad(cost)(init_params)``` The error is qml.Displacement(mag_alpha, phase_alpha) | wires = 0 ^ SyntaxError: can't assign to operator