class_docstr: Tests for the hamiltonian_expand transform
class_docstr_tok: ["Tests","for","the","hamiltonian_expand","transform"]
docstr: Tests the correct number of quantum scripts are produced.
docstr_tok: ["Tests","the","correct","number","of","quantum","scripts","are","produced","."]
code: def test_number_of_qscripts(self):
      """Tests the correct number of quantum scripts are produced."""
  
      H = qml.Hamiltonian(
          [1.0, 2.0, 3.0], [qml.PauliZ(0), qml.PauliX(1), qml.PauliX(0)]
      )
      qs = QuantumScript(measurements=[qml.expval(H)])
  
      tapes, _ = hamiltonian_expand(qs, group=False)
      assert len(tapes) == 3
  
      tapes, _ = hamiltonian_expand(qs, group=True)
      assert len(tapes) == 2
  
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 6 for calling the TestHamiltonianExpand obj's underlying member method code with example usage: obj.test_number_of_qscripts() without return types