def test_qnode_fails_on_qfunc_with_too_many_wires(self, qubit_device_2_wires):
    'The device must have sufficient wires for the qfunc'

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def qf(x):
        qml.RX(x, wires=[0])
        qml.CNOT(wires=[0, 2])
        return qml.expval(qml.PauliZ(0))
    with pytest.raises(QuantumFunctionError, match='applied to invalid wire'):
        qf(Variable(0.5))
The device must have sufficient wires for the qfunc
def test_qnode_fails_on_qfunc_with_too_many_wires(self, qubit_device_2_wires):
    

    @qml.qnode(qubit_device_2_wires, interface='tf')
    def qf(x):
        qml.RX(x, wires=[0])
        qml.CNOT(wires=[0, 2])
        return qml.expval(qml.PauliZ(0))
    with pytest.raises(QuantumFunctionError, match='applied to invalid wire'):
        qf(Variable(0.5))