I have encountered a problem in naming a parameter while printing the result as fellow, please help.
I have a tutorial quantum natural gradient that provide an example to name parameter like params, params
qml.RZ(params, wires = 0) qml.RZ(params, wires = 1)
I want to make use of the above naming pattern to measure a tensor-product observable
qml.RX(params,wires = 0)
qml.RY(params,wires = 0)
qml.CNOT(wires = [0, 1])
#my_circuit(wires = (1,0))
return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
But when I type the following code
print(circuit(np.pi / 2))
it generate an error:
‘Variable’ object is not subscriptable
I know the technique by following this tutorial
Could anyone please give me some hint how to correct it?