Repository: PennyLaneAI/pennylane

Issue:
`"Reversible"` is suggested as valid `diff_method`, but isn't one
*Expected behaviour:*
The error message when providing a `diff_method` to a QNode is correct.

*Actual behaviour:*
A choice for `diff_method` that is not available is suggested to be available by the error message:

```python
dev = qml.device("default.qubit", wires=2)

@qml.qnode(dev, diff_method="reversible")
def circuit_probs(x):
    qml.RX(x, wires=0)
    return qml.probs(wires=[0, 1])
```
returns a `QuantumFunctionError`:
```python
QuantumFunctionError: Differentiation method reversible not recognized. Allowed options are ('best', 'parameter-shift', 'backprop', 'finite-diff', 'device', 'reversible', 'adjoint').
```
where the `"reversible"` choice (second to last suggestion of the error message) is exactly what we tried to use.

I am not sure about the `"reversible"` method, but I suppose we only need to remove it from the error message.


Discussion:

Resolving patch:
diff --git a/pennylane/_qubit_device.py b/pennylane/_qubit_device.py
--- a/pennylane/_qubit_device.py
+++ b/pennylane/_qubit_device.py
@@ -845,8 +845,7 @@ def adjoint_jacobian(self, tape, starting_state=None, use_device_state=False):
         `Jones and Gacon <https://arxiv.org/abs/2009.02823>`__ to differentiate an input tape.
 
         After a forward pass, the circuit is reversed by iteratively applying inverse (adjoint)
-        gates to scan backwards through the circuit. This method is similar to the reversible
-        method, but has a lower time overhead and a similar memory overhead.
+        gates to scan backwards through the circuit.
 
         .. note::
             The adjoint differentiation method has the following restrictions:
diff --git a/pennylane/qnode.py b/pennylane/qnode.py
--- a/pennylane/qnode.py
+++ b/pennylane/qnode.py
@@ -313,7 +313,7 @@ def get_gradient_fn(device, interface, diff_method="best"):
         if isinstance(diff_method, str):
             raise qml.QuantumFunctionError(
                 f"Differentiation method {diff_method} not recognized. Allowed "
-                "options are ('best', 'parameter-shift', 'backprop', 'finite-diff', 'device', 'reversible', 'adjoint')."
+                "options are ('best', 'parameter-shift', 'backprop', 'finite-diff', 'device', 'adjoint')."
             )
 
         if isinstance(diff_method, qml.gradients.gradient_transform):
@@ -421,10 +421,9 @@ def _validate_adjoint_method(device):
         # need to inspect the circuit measurements to ensure only expectation values are taken. This
         # cannot be done here since we don't yet know the composition of the circuit.
 
-        supported_device = hasattr(device, "_apply_operation")
-        supported_device = supported_device and hasattr(device, "_apply_unitary")
+        required_attrs = ["_apply_operation", "_apply_unitary", "adjoint_jacobian"]
+        supported_device = all(hasattr(device, attr) for attr in required_attrs)
         supported_device = supported_device and device.capabilities().get("returns_state")
-        supported_device = supported_device and hasattr(device, "adjoint_jacobian")
 
         if not supported_device:
             raise ValueError(


Test patch:
diff --git a/tests/devices/test_default_qubit_torch.py b/tests/devices/test_default_qubit_torch.py
--- a/tests/devices/test_default_qubit_torch.py
+++ b/tests/devices/test_default_qubit_torch.py
@@ -1540,7 +1540,7 @@ def circuit(x, w=None):
             assert qml.qnode(dev, diff_method="autograd", interface=interface)(circuit)
         assert (
             str(e.value)
-            == "Differentiation method autograd not recognized. Allowed options are ('best', 'parameter-shift', 'backprop', 'finite-diff', 'device', 'reversible', 'adjoint')."
+            == "Differentiation method autograd not recognized. Allowed options are ('best', 'parameter-shift', 'backprop', 'finite-diff', 'device', 'adjoint')."
         )
 
 
diff --git a/tests/ops/qubit/test_hamiltonian.py b/tests/ops/qubit/test_hamiltonian.py
--- a/tests/ops/qubit/test_hamiltonian.py
+++ b/tests/ops/qubit/test_hamiltonian.py
@@ -1646,29 +1646,3 @@ def circuit(coeffs, param):
             match="Adjoint differentiation method does not support Hamiltonian observables",
         ):
             grad_fn(coeffs, param)
-
-    @pytest.mark.xfail
-    def test_not_supported_by_reverse_differentiation(self):
-        """Test that error is raised when attempting the reverse differentiation method."""
-        dev = qml.device("default.qubit", wires=2)
-
-        coeffs = pnp.array([-0.05, 0.17], requires_grad=True)
-        param = pnp.array(1.7, requires_grad=True)
-
-        @qml.qnode(dev, diff_method="reversible")
-        def circuit(coeffs, param):
-            qml.RX(param, wires=0)
-            qml.RY(param, wires=0)
-            return qml.expval(
-                qml.Hamiltonian(
-                    coeffs,
-                    [qml.PauliX(0), qml.PauliZ(0)],
-                )
-            )
-
-        grad_fn = qml.grad(circuit)
-        with pytest.raises(
-            qml.QuantumFunctionError,
-            match="Reverse differentiation method does not support Hamiltonian observables",
-        ):
-            grad_fn(coeffs, param)