class_docstr: Test assertions involving decompositions.
class_docstr_tok: ["Test","assertions","involving","decompositions","."]
docstr: Test that decomposition and expand must match.
docstr_tok: ["Test","that","decomposition","and","expand","must","match","."]
code: def test_decomposition_must_match_expand(self):
      """Test that decomposition and expand must match."""
  
      class BadDecomp(Operator):
          @staticmethod
          def compute_decomposition(wires):
              return [qml.RY(2.3, 0)]
  
          def expand(self):
              return qml.tape.QuantumScript([qml.S(0)])
  
      with pytest.raises(
          AssertionError, match="decomposition must match expansion"
      ):
          assert_valid(BadDecomp(wires=0), skip_pickle=True)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.operation import Operator
  from pennylane.ops.functions import assert_valid
label_desc: Use image node_id 4 for calling the TestDecompositionErrors obj's underlying member method code with example usage: obj.test_decomposition_must_match_expand() and returns: list, qml