class_docstr: Tests for the behavior of the `decompose` helper.
class_docstr_tok: ["Tests","for","the","behavior","of","the","`","decompose","`","helper","."]
docstr: Test that decompose expands the tape when unsupported operators are present
docstr_tok: ["Test","that","decompose","expands","the","tape","when","unsupported","operators","are","present"]
code: def test_decompose_expand_unsupported_op(self, shots):
      """Test that decompose expands the tape when unsupported operators are present"""
      ops = [qml.Hadamard(0), NoMatOp(1), qml.RZ(0.123, wires=1)]
      measurements = [qml.expval(qml.PauliZ(0)), qml.probs()]
      tape = QuantumScript(
          ops=ops, measurements=measurements, shots=shots
      )
  
      expanded_tapes, _ = decompose(tape, lambda obj: obj.has_matrix)
      expanded_tape = expanded_tapes[0]
      expected = [
          qml.Hadamard(0),
          qml.PauliX(1),
          qml.PauliY(1),
          qml.RZ(0.123, wires=1),
      ]
  
      for op, exp in zip(
          expanded_tape.circuit, expected + measurements
      ):
          assert qml.equal(op, exp)
  
      assert tape.shots == expanded_tape.shots
  
imports: import pytest
  import pennylane
  from pennylane.operation import Operation
  from pennylane.tape import QuantumScript
  from pennylane import DeviceError
  from pennylane.devices.preprocess import no_sampling, validate_device_wires, validate_multiprocessing_workers, validate_adjoint_trainable_params, _operator_decomposition_gen, decompose, validate_observables, validate_measurements
label_desc: Use image node_id 1 for calling the TestDecomposeTransformations obj's underlying member method code with example usage: obj.test_decompose_expand_unsupported_op(shots) without return types