class_docstr: Tests for the hamiltonian_expand transform
class_docstr_tok: ["Tests","for","the","hamiltonian_expand","transform"]
docstr: Tests that the hamiltonian_expand transform returns the correct value
  if we switch grouping off
docstr_tok: ["Tests","that","the","hamiltonian_expand","transform","returns","the","correct","value","if","we","switch","grouping","off"]
code: def test_hamiltonians_no_grouping(self, tape, output):
      """Tests that the hamiltonian_expand transform returns the correct value
      if we switch grouping off"""
  
      tapes, fn = hamiltonian_expand(tape, group=False)
      results = dev.execute(tapes)
      expval = fn(results)
  
      assert np.isclose(output, expval)
  
      qs = QuantumScript(tape.operations, tape.measurements)
      tapes, fn = hamiltonian_expand(qs, group=False)
      results = dev.execute(tapes)
      expval = fn(results)
  
      assert np.isclose(output, expval)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.queuing import AnnotatedQueue
  from pennylane.tape import QuantumScript
  from pennylane.transforms import hamiltonian_expand, sum_expand
label_desc: Use image node_id 3 for calling the TestHamiltonianExpand obj's underlying member method code with example usage: obj.test_hamiltonians_no_grouping(tape, output) without return types