1Variational Training
A QNN is essentially a function f(x, w) that maps input data x to an output using trainable parameters w. This is identical to classical deep learning but executed on a quantum state.
2The Parameter Shift Rule
Since we cannot 'look inside' a quantum computer without collapsing the state, we use the parameter shift rule to calculate gradients by shifting the weights and measuring the difference.
3Step-by-Step Breakdown
Neural Analogy. QNNs are parameterized quantum circuits that behave like artificial neural networks.
The Ansatz. Each layer consists of rotations (weights) and entanglements.
Forward Pass. Encoding data, running the circuit, and measuring the output.
Activation Functions. The periodic nature of quantum gates provides natural non-linearity.
Training. We update the circuit weights using gradient descent.
Parameter Shift Rule. A quantum-specific way to calculate exact gradients on hardware.
Check. Which rule allows calculating gradients on real quantum hardware?
- →Backpropagation
- →Parameter Shift Rule
Hybrid Layers. Integrating QNNs into PyTorch or TensorFlow workflows.
Scalability. Handling the 'Barren Plateau' problem where gradients vanish.
End. QNNs mastered.
Update a Real Variational Parameter. Finish applying one gradient descent step to a quantum circuit's variational parameter.
