class_docstr: Tests for the hamiltonian_expand transform
class_docstr_tok: ["Tests","for","the","hamiltonian_expand","transform"]
docstr: Tests that the shots attribute is copied to the new tapes
docstr_tok: ["Tests","that","the","shots","attribute","is","copied","to","the","new","tapes"]
code: def test_shots_attribute(self, shots, group):
      """Tests that the shots attribute is copied to the new tapes"""
      H = qml.Hamiltonian(
          [1.0, 2.0, 3.0], [qml.PauliZ(0), qml.PauliX(1), qml.PauliX(0)]
      )
  
      with AnnotatedQueue() as q:
          qml.Hadamard(wires=0)
          qml.CNOT(wires=[0, 1])
          qml.PauliX(wires=2)
          qml.expval(H)
  
      tape = QuantumScript.from_queue(q, shots=shots)
      new_tapes, _ = hamiltonian_expand(tape, group=group)
  
      assert all(new_tape.shots == tape.shots for new_tape in new_tapes)
  
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 7 for calling the TestHamiltonianExpand obj's underlying member method code with example usage: obj.test_shots_attribute(shots, group) without return types