class_docstr: Unit tests for validate_and_expand_adjoint
class_docstr_tok: ["Unit","tests","for","validate_and_expand_adjoint"]
docstr: Test that a warning is raised and all parameters are trainable in the expanded
  tape when not all parameters in U3 are trainable
docstr_tok: ["Test","that","a","warning","is","raised","and","all","parameters","are","trainable","in","the","expanded","tape","when","not","all","parameters","in","U3","are","trainable"]
code: def test_u3_non_trainable_params(self):
      """Test that a warning is raised and all parameters are trainable in the expanded
      tape when not all parameters in U3 are trainable"""
      qs = qml.tape.QuantumScript(
          [qml.U3(0.2, 0.4, 0.6, wires=0)], [qml.expval(qml.PauliZ(0))]
      )
      qs.trainable_params = [0, 2]
  
      program = qml.device("default.qubit").preprocess(
          ExecutionConfig(gradient_method="adjoint")
      )[0]
      res, _ = program((qs,))
      res = res[0]
      assert isinstance(res, qml.tape.QuantumScript)
  
      # U3 decomposes into 5 operators
      assert len(res.operations) == 5
      assert res.trainable_params == [0, 1, 2, 3, 4]
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices import DefaultQubit, ExecutionConfig
  from pennylane.devices.default_qubit import stopping_condition
label_desc: Use image node_id 5 for calling the TestAdjointDiffTapeValidation obj's underlying member method code with example usage: obj.test_u3_non_trainable_params() without return types