class_docstr: Test that the device can implement all gates that it claims to support.
class_docstr_tok: ["Test","that","the","device","can","implement","all","gates","that","it","claims","to","support","."]
docstr: Test that the device can implement all its supported gates.
docstr_tok: ["Test","that","the","device","can","implement","all","its","supported","gates","."]
code: def test_supported_gates_can_be_implemented(
      self, device_kwargs, operation
  ):
      """Test that the device can implement all its supported gates."""
      device_kwargs["wires"] = 4  # maximum size of current gates
      dev = qml.device(**device_kwargs)
  
      assert hasattr(dev, "operations")
      if operation in dev.operations:
  
          @qml.qnode(dev)
          def circuit():
              qml.apply(ops[operation])
              return qml.expval(qml.Identity(wires=0))
  
          assert isinstance(circuit(), (float, np.ndarray))
  
imports: from cmath import exp
  from math import cos, sin, sqrt
  import pytest
  import numpy
  from scipy.linalg import block_diag
  from flaky import flaky
  import pennylane
label_desc: Use image node_id 1 for calling the TestSupportedGates obj's underlying member method code with example usage: obj.test_supported_gates_can_be_implemented(device_kwargs, operation) and returns: qml