Hello,
I found the notebook tutorial_qaoa_maxcut.ipynb
returns an error for the following block of code.
pauli_z = [[1, 0], [0, -1]]
pauli_z_2 = np.kron(pauli_z, pauli_z, requires_grad=False)
@qml.qnode(dev)
def circuit(gammas, betas, edge=None, n_layers=1):
# apply Hadamards to get the n qubit |+> state
for wire in range(n_wires):
qml.Hadamard(wires=wire)
# p instances of unitary operators
for i in range(n_layers):
U_C(gammas[i])
U_B(betas[i])
if edge is None:
# measurement phase
return qml.sample()
# during the optimization phase we are evaluating a term
# in the objective using expval
return qml.expval(qml.Hermitian(pauli_z_2, wires=edge))
The error returned is:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-9b14f55d55c2> in <module>
1 pauli_z = [[1, 0], [0, -1]]
----> 2 pauli_z_2 = np.kron(pauli_z, pauli_z, requires_grad=False)
3
4
5 @qml.qnode(dev)
<__array_function__ internals> in kron(*args, **kwargs)
TypeError: _kron_dispatcher() got an unexpected keyword argument 'requires_grad'