Questions on QGAN tutorial

Hello, I have some questions about Quantum GAN. For point (3) Non-Linear Transform, I did not know why we could add the ancilla qubit to create the non-linear transformation. Another question is, don’t we lose the critical information of the image while tracing out the ancilla qubit?


Hi @mini, thanks for the question :slight_smile:

Strictly speaking, it’s not necessary to include a non-linear transformation here. The author of this demo likely included it as it’s one way to make the model “more interesting”.

Adding an ancilla qubit alone is not enough to make the quantum process nonlinear. It’s the fact that we make a measurement that causes this (as the author says, the resulting state depends on the variable z in both the numerator and the denominator, making a nonlinear dependence on z. One could also add a measurement on the non-ancilla qubits, but this would consume them. Instead, we can use an ancilla to give us something to measure without changing the number of working qubits our model uses.

As for your second question, one of the goals of introducing a nonlinearity into a (Q)ML model is in fact to lose information. For example, we may need to go down from a very high-dimensional object (an image), to a single number (prediction for the class of that image). This requires throwing away some information! The task of machine learning is to train your model (in this case, a quantum circuit) to only throw away information that is not useful, while keeping critical information that is useful for making the final prediction.

Hope this helps :slight_smile: