Parallel Circuit execution during optimisation

Hi, @Tz_19
Thank you for your question. I used your code and was able to reproduce the error.
The first thing is that you are trying to do parameter broadcasting for qml.Hermitian but this isn’t supported yet (see here).
Just to double check, I tried to follow the example presented for qml.transforms.broadcast_expand with qml.Hermitian in a simplified example and got the same error as you.

import pennylane as qml
from pennylane import numpy as np
qml.Hermitian.ndim_params = (2,)
dev = qml.device("lightning.qubit", wires=1)
@qml.qnode(dev)
def circuit(x):
    return qml.expval(qml.Hermitian(x, wires=range(1)))

expanded_circuit = qml.transforms.broadcast_expand(circuit)
x = np.array([[[0.2, 0.6],[0.5, 1.0]],[[0.2, 0.6],[0.5, 1.0]]], requires_grad=True)
print(expanded_circuit(x))

Given that in topic #8124 they were able to implement an example using qml.Hermitian, it will be wise to give JAX a chance. This demo and that forum discussion can be helpful.

Let us know of any questions you might have while trying this new approach.