class_docstr: Tests logic when derivatives, vjp, or jvp are overridden.
class_docstr_tok: ["Tests","logic","when","derivatives",",","vjp",",","or","jvp","are","overridden","."]
docstr: Tests default logic for a device with a derivative provided.
docstr_tok: ["Tests","default","logic","for","a","device","with","a","derivative","provided","."]
code: def test_provided_derivative(self):
      """Tests default logic for a device with a derivative provided."""
  
      class WithDerivative(Device):
          """A device with a derivative."""
  
          # pylint: disable=unused-argument
          def execute(
              self,
              circuits,
              execution_config: ExecutionConfig = DefaultExecutionConfig,
          ):
              return "a"
  
          def compute_derivatives(
              self,
              circuits,
              execution_config: ExecutionConfig = DefaultExecutionConfig,
          ):
              return ("b",)
  
      dev = WithDerivative()
      assert dev.supports_derivatives()
      assert not dev.supports_derivatives(
          ExecutionConfig(derivative_order=2)
      )
      assert not dev.supports_derivatives(
          ExecutionConfig(gradient_method="backprop")
      )
      assert dev.supports_derivatives(
          ExecutionConfig(gradient_method="device")
      )
  
      out = dev.execute_and_compute_derivatives(
          qml.tape.QuantumScript()
      )
      assert out[0] == "a"
      assert out[1] == ("b",)
  
imports: import pytest
  import pennylane
  from pennylane.devices import Device, ExecutionConfig, DefaultExecutionConfig
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling the TestProvidingDerivatives obj's underlying member method code with example usage: obj.test_provided_derivative() and returns: str, str