class_docstr: Unit tests for the preprocessing method.
class_docstr_tok: ["Unit","tests","for","the","preprocessing","method","."]
docstr: Tests adjoint accepts operators with no parameters or a single parameter and a generator.
docstr_tok: ["Tests","adjoint","accepts","operators","with","no","parameters","or","a","single","parameter","and","a","generator","."]
code: def test_adjoint_only_one_wire(self):
      """Tests adjoint accepts operators with no parameters or a single parameter and a generator."""
  
      program = qml.device("default.qubit").preprocess(
          ExecutionConfig(gradient_method="adjoint")
      )[0]
  
      class MatOp(qml.operation.Operation):
          """Dummy operation for expanding circuit."""
  
          # pylint: disable=arguments-renamed, invalid-overridden-method
          @property
          def has_matrix(self):
              return True
  
          def decomposition(self):
              return [qml.PauliX(self.wires), qml.PauliY(self.wires)]
  
      tape1 = qml.tape.QuantumScript([MatOp(wires=0)])
      batch, _ = program((tape1,))
      assert batch[0].circuit == tape1.circuit
  
      tape2 = qml.tape.QuantumScript([MatOp(1.2, wires=0)])
      batch, _ = program((tape2,))
      assert batch[0].circuit != tape2.circuit
  
      tape3 = qml.tape.QuantumScript([MatOp(1.2, 2.3, wires=0)])
      batch, _ = program((tape2,))
      assert batch[0].circuit != tape3.circuit
  
      class CustomOpWithGenerator(qml.operation.Operator):
          """A custom operator with a generator."""
  
          def generator(self):
              return qml.PauliX(0)
  
          # pylint: disable=arguments-renamed, invalid-overridden-method
          @property
          def has_matrix(self):
              return True
  
      tape4 = qml.tape.QuantumScript(
          [CustomOpWithGenerator(1.2, wires=0)]
      )
      batch, _ = program((tape4,))
      assert batch[0].circuit == tape4.circuit
  
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 7 for calling the TestPreprocessing obj's underlying member method code with example usage: obj.test_adjoint_only_one_wire() and returns: True, list, qml, True