Hi PennyLane team!
I am trying to execute two QNodes at the same time but something goes wrong:
import pennylane as qml
dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def circuit1(x, y):
qml.Hadamard(0)
qml.RX(x, wires=0)
qml.RY(y, wires=1)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(0))
@qml.qnode(dev)
def circuit2(x, y):
qml.RX(x, wires=0)
qml.RY(y, wires=0)
return qml.expval(qml.PauliY(0)), qml.probs(wires=[0,1])
qnodes = qml.QNodeCollection([circuit1, circuit2])
qnodes(0.5643, -0.45)
~/pennylane/pennylane/collections/qnode_collection.py in convert_results(results, interface)
269 from autograd import numpy as np
270
--> 271 return np.stack(results)
272
273 return results
~/autograd/autograd/numpy/numpy_wrapper.py in stack(arrays, axis)
92 shapes = set(arr.shape for arr in arrays)
93 if len(shapes) != 1:
---> 94 raise ValueError('all input arrays must have the same shape')
95
96 result_ndim = arrays[0].ndim + 1
ValueError: all input arrays must have the same shape
Please help me, what is the issue here?