I am trying to train a quantum neural network in tensorflow_quantum (tfq). Using cirq.Circuit I have set up my circuit. I now need to wrap it in a keras model for training. For this I must embed the circuit in a tfq.layers.PQC layer (according to the documentation: "this layer is for training parameterized quantum models"). However, when using PQC, I must specify a value for the parameter operators, which must be a cirq.PauliSum or Python list of cirq.PauliSum objects. I am unsure how to obtain the amplitudes via these kind of operators, but since I am dealing with a simulator I think it should not be necessary. Is there a way to train my circuit using the amplitudes of the circuit output? Thanks in advance.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.