class_docstr: Test that the device can implement all observables that it supports.
class_docstr_tok: ["Test","that","the","device","can","implement","all","observables","that","it","supports","."]
docstr: Test that the device can implement a simple tensor observable.
  This test is skipped for devices that do not support tensor observables.
code: def test_tensor_observables_can_be_implemented(self, device_kwargs):
      """Test that the device can implement a simple tensor observable.
      This test is skipped for devices that do not support tensor observables.
      """
      device_kwargs["wires"] = 2
      dev = qml.device(**device_kwargs)
      supports_tensor = (
          "supports_tensor_observables" in dev.capabilities()
          and dev.capabilities()["supports_tensor_observables"]
      )
      if not supports_tensor:
          pytest.skip("Device does not support tensor observables.")
  
      @qml.qnode(dev)
      def circuit():
          if dev.supports_operation(
              qml.PauliX
          ):  # ionq can't have empty circuits
              qml.PauliX(0)
          return qml.expval(
              qml.Identity(wires=0) @ qml.Identity(wires=1)
          )
  
      assert isinstance(circuit(), (float, np.ndarray))
  
imports: import pytest
  from flaky import flaky
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, MeasurementTransform, SampleMeasurement, SampleMP, StateMeasurement, StateMP
label_desc: Use image node_id 2 for calling the TestSupportedObservables obj's underlying member method code with example usage: obj.test_tensor_observables_can_be_implemented(device_kwargs) and returns: qml