class_docstr: Tests conditional operations
docstr: Test that the defer_measurements transform works with
  qml.Hamiltonian.
docstr_tok: ["Test","that","the","defer_measurements","transform","works","with","qml.Hamiltonian","."]
code: def test_hamiltonian_queued(self):
      """Test that the defer_measurements transform works with
      qml.Hamiltonian."""
      rads = 0.3
      a = qml.PauliX(3)
      b = qml.PauliX(1)
      c = qml.PauliZ(2)
      obs = [a, b, c]
      coeffs = [1.0, 2.0, 3.0]
  
      H = qml.Hamiltonian(coeffs, obs, grouping_type="qwc")
  
      with qml.queuing.AnnotatedQueue() as q:
          m_0 = qml.measure(0)
          qml.cond(m_0, qml.RY)(rads, wires=4)
          qml.expval(H)
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tapes, _ = qml.defer_measurements(tape)
      tape = tapes[0]
      assert len(tape.operations) == 1
      assert len(tape.measurements) == 1
  
      # Check the underlying Controlled instance
      first_ctrl_op = tape.operations[0]
      assert isinstance(first_ctrl_op, qml.ops.op_math.Controlled)
      assert qml.equal(first_ctrl_op.base, qml.RY(rads, 4))
      assert len(tape.measurements) == 1
      assert isinstance(
          tape.measurements[0], qml.measurements.MeasurementProcess
      )
      assert qml.equal(tape.measurements[0].obs, H)
  
imports: import math
  import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  import pennylane.numpy
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 7 for calling the TestConditionalOperations obj's underlying member method code with example usage: obj.test_hamiltonian_queued() without return types