class_docstr: Test that the measure_with_samples function works as expected for
  Hamiltonian and Sum observables
class_docstr_tok: ["Test","that","the","measure_with_samples","function","works","as","expected","for","Hamiltonian","and","Sum","observables"]
docstr: Test that sampling works for Sums with large numbers of wires
docstr_tok: ["Test","that","sampling","works","for","Sums","with","large","numbers","of","wires"]
code: def test_multi_wires(self):
      """Test that sampling works for Sums with large numbers of wires"""
      n_wires = 10
      scale = 0.05
      offset = 0.8
  
      ops = [
          qml.RX(offset + scale * i, wires=i) for i in range(n_wires)
      ]
  
      t1 = 2.5 * qml.prod(*(qml.PauliZ(i) for i in range(n_wires)))
      t2 = 6.2 * qml.prod(*(qml.PauliY(i) for i in range(n_wires)))
      H = t1 + t2
  
      qs = qml.tape.QuantumScript(ops, [qml.expval(H)], shots=100000)
      res = simulate(qs, rng=100)
  
      phase = offset + scale * np.array(range(n_wires))
      cosines = qml.math.cos(phase)
      sines = qml.math.sin(phase)
      expected = 2.5 * qml.math.prod(cosines) + 6.2 * qml.math.prod(
          sines
      )
  
      assert np.allclose(res, expected, atol=0.05)
  
imports: from random import shuffle
  import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.simulate import _FlexShots
  from pennylane.devices.qubit import sample_state, measure_with_samples
  from pennylane.devices.qubit.sampling import _sample_state_jax
  from pennylane.measurements import Shots
label_desc: Use image node_id 5 for calling the TestHamiltonianSamples obj's underlying member method code with example usage: obj.test_multi_wires() without return types