docstr: Test that `Sum` expectation values are correct when eigenvalues are used
  for computation.
docstr_tok: ["Test","that","`","Sum","`","expectation","values","are","correct","when","eigenvalues","are","used","for","computation","."]
code: def test_sum_expval_eigs(self, obs, expected):
      """Test that `Sum` expectation values are correct when eigenvalues are used
      for computation."""
      ops = [qml.RX(i * np.pi / 2 + 0.123, wires=i) for i in range(8)]
      meas = [qml.expval(obs)]
      qs = qml.tape.QuantumScript(ops, meas)
  
      res = simulate(qs)
      assert np.allclose(res, expected)
  
imports: import pytest
  import numpy
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.measure import measure, state_diagonalizing_gates, csr_dot_products, full_dot_products, get_measurement_function, sum_of_terms_method
label_desc: Use image node_id 4 for calling the TestMeasurements obj's underlying member method code with example usage: obj.test_sum_expval_eigs(obs, expected) without return types