class_docstr: Composite Operations use math.linalg.eig instead of math.linalg.eigh since the operators
  may not be hermitian.
class_docstr_tok: ["Composite","Operations","use","math.linalg.eig","instead","of","math.linalg.eigh","since","the","operators","may","not","be","hermitian","."]
docstr: Test that a sum op returns the correct eigvals.
docstr_tok: ["Test","that","a","sum","op","returns","the","correct","eigvals","."]
code: def test_sum_eigvals(self):
      """Test that a sum op returns the correct eigvals."""
      sum_op = qml.sum(
          qml.s_prod(1j, qml.PauliZ(wires=0)), qml.Identity(wires=0)
      )
      sum_eigvals = qml.eigvals(sum_op)
  
      mat_rep = np.array([[1 + 1j, 0], [0, 1 - 1j]])
      mat_eigvals = np.linalg.eig(mat_rep)[0]
  
      assert np.allclose(mat_eigvals, sum_eigvals)
  
imports: from functools import reduce
  import pytest
  import scipy
  from gate_data import CNOT, H, I, S, X, Y, Z
  import pennylane
  from pennylane import numpy
  from pennylane.transforms.op_transforms import OperationTransformError
label_desc: Use image node_id 1 for calling the TestCompositeOperations obj's underlying member method code with example usage: obj.test_sum_eigvals() without return types