Using AmplitideEmbedding Template

Hi @Hemant_Gahankari,

Thanks so much for your question! :slight_smile:

When defining a quantum function (a function that is passed to a QNode), non-differentiable parameters (such as inputs in this case) require a default value to be defined. This is how differentiable parameters of a quantum function are being tracked when creating a QNode.

In this specific case, the definition of the qnode function could be changed to def qnode(weights, inputs=None). This way weights is marked as differentiable and inputs as non-differentiable.

Further to this, there is an upcoming QNode using the new QuantumTape class. This is at the moment in experimental phase and compatibility with templates (such as AmplitudeEmbedding) is underway! :slight_smile:

Hope this helps!

1 Like