def test_array_parameters_evaluate(self, qubit_device_2_wires, tol):
    'Test that array parameters gives same result as positional arguments.'
    (a, b, c) = (tf.constant(0.5), tf.constant(0.54), tf.constant(0.3))

    def ansatz(x, y, z):
        qml.QubitStateVector((np.array([1, 0, 1, 1]) / np.sqrt(3)), wires=[0, 1])
        qml.Rot(x, y, z, wires=0)
        qml.CNOT(wires=[0, 1])
        return (qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1)))

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit1(x, y, z):
        return ansatz(x, y, z)

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit2(x, array):
        return ansatz(x, array[0], array[1])

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit3(array):
        return ansatz(*array)
    positional_res = circuit1(a, b, c)
    array_res1 = circuit2(a, Variable([b, c]))
    array_res2 = circuit3(Variable([a, b, c]))
    assert np.allclose(positional_res.numpy(), array_res1.numpy(), atol=tol, rtol=0)
    assert np.allclose(positional_res.numpy(), array_res2.numpy(), atol=tol, rtol=0)
Test that array parameters gives same result as positional arguments.
def test_array_parameters_evaluate(self, qubit_device_2_wires, tol):
    
    (a, b, c) = (tf.constant(0.5), tf.constant(0.54), tf.constant(0.3))

    def ansatz(x, y, z):
        qml.QubitStateVector((np.array([1, 0, 1, 1]) / np.sqrt(3)), wires=[0, 1])
        qml.Rot(x, y, z, wires=0)
        qml.CNOT(wires=[0, 1])
        return (qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1)))

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit1(x, y, z):
        return ansatz(x, y, z)

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit2(x, array):
        return ansatz(x, array[0], array[1])

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def circuit3(array):
        return ansatz(*array)
    positional_res = circuit1(a, b, c)
    array_res1 = circuit2(a, Variable([b, c]))
    array_res2 = circuit3(Variable([a, b, c]))
    assert np.allclose(positional_res.numpy(), array_res1.numpy(), atol=tol, rtol=0)
    assert np.allclose(positional_res.numpy(), array_res2.numpy(), atol=tol, rtol=0)