def test_multiple_expectation_different_wires(self, qubit_device_2_wires, tol):
    'Tests that qnodes return multiple expectation values.'
    (a, b, c) = (Variable(0.5), Variable(0.54), Variable(0.3))

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit(x, y, z):
        qml.RX(x, wires=[0])
        qml.RZ(y, wires=[0])
        qml.CNOT(wires=[0, 1])
        qml.RY(y, wires=[0])
        qml.RX(z, wires=[0])
        return (qml.expval(qml.PauliY(0)), qml.expval(qml.PauliZ(1)))
    res = circuit(a, b, c)
    out_state = (((((np.kron(Rotx(c.numpy()), I) @ np.kron(Roty(b.numpy()), I)) @ CNOT) @ np.kron(Rotz(b.numpy()), I)) @ np.kron(Rotx(a.numpy()), I)) @ np.array([1, 0, 0, 0]))
    ex0 = np.vdot(out_state, (np.kron(Y, I) @ out_state))
    ex1 = np.vdot(out_state, (np.kron(I, Z) @ out_state))
    ex = np.array([ex0, ex1])
    assert np.allclose(ex, res.numpy(), atol=tol, rtol=0)
Tests that qnodes return multiple expectation values.
def test_multiple_expectation_different_wires(self, qubit_device_2_wires, tol):
    
    (a, b, c) = (Variable(0.5), Variable(0.54), Variable(0.3))

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit(x, y, z):
        qml.RX(x, wires=[0])
        qml.RZ(y, wires=[0])
        qml.CNOT(wires=[0, 1])
        qml.RY(y, wires=[0])
        qml.RX(z, wires=[0])
        return (qml.expval(qml.PauliY(0)), qml.expval(qml.PauliZ(1)))
    res = circuit(a, b, c)
    out_state = (((((np.kron(Rotx(c.numpy()), I) @ np.kron(Roty(b.numpy()), I)) @ CNOT) @ np.kron(Rotz(b.numpy()), I)) @ np.kron(Rotx(a.numpy()), I)) @ np.array([1, 0, 0, 0]))
    ex0 = np.vdot(out_state, (np.kron(Y, I) @ out_state))
    ex1 = np.vdot(out_state, (np.kron(I, Z) @ out_state))
    ex = np.array([ex0, ex1])
    assert np.allclose(ex, res.numpy(), atol=tol, rtol=0)