class_docstr: Test the expansion of operations without a unitary generator.
class_docstr_tok: ["Test","the","expansion","of","operations","without","a","unitary","generator","."]
docstr: Test that a tape with single-parameter operations with
  unitary generators and non-parametric operations is not touched.
docstr_tok: ["Test","that","a","tape","with","single-parameter","operations","with","unitary","generators","and","non-parametric","operations","is","not","touched","."]
code: def test_expand_missing_generator(self):
      """Test that a tape with single-parameter operations with
      unitary generators and non-parametric operations is not touched.
      """
  
      class _PhaseShift(qml.PhaseShift):
          def generator(self):
              return None
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(0.2, wires=0)
          qml.Hadamard(0)
          _PhaseShift(2.1, wires=1)
          qml.SingleExcitationPlus(-1.2, wires=[1, 0])
  
      tape = qml.tape.QuantumScript.from_queue(q)
      new_tape = qml.transforms.expand_nonunitary_gen(tape)
      assert tape.operations[:2] == new_tape.operations[:2]
      exp_op, gph_op = new_tape.operations[2:4]
      assert (
          exp_op.name == "RZ"
          and exp_op.data == (2.1,)
          and exp_op.wires == qml.wires.Wires(1)
      )
      assert gph_op.name == "GlobalPhase" and gph_op.data == (
          -2.1 * 0.5,
      )
      assert tape.operations[3:] == new_tape.operations[4:]
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 3 for calling the TestExpandNonunitaryGen obj's underlying member method code with example usage: obj.test_expand_missing_generator() and returns: None