class_docstr: Tests for the QubitSum operator
docstr: Test that the matrix representation is defined correctly
docstr_tok: ["Test","that","the","matrix","representation","is","defined","correctly"]
code: def test_matrix_representation(self, tol):
      """Test that the matrix representation is defined correctly"""
  
      res_static = qml.QubitSum.compute_matrix()
      res_dynamic = qml.QubitSum(wires=[0, 1, 2]).matrix()
      expected = np.array(
          [
              [1, 0, 0, 0, 0, 0, 0, 0],
              [0, 1, 0, 0, 0, 0, 0, 0],
              [0, 0, 0, 1, 0, 0, 0, 0],
              [0, 0, 1, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 1, 0, 0],
              [0, 0, 0, 0, 1, 0, 0, 0],
              [0, 0, 0, 0, 0, 0, 1, 0],
              [0, 0, 0, 0, 0, 0, 0, 1],
          ]
      )
      assert np.allclose(res_static, expected, atol=tol)
      assert np.allclose(res_dynamic, expected, atol=tol)
  
imports: import copy
  import itertools
  import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 3 for calling the TestQubitSum obj's underlying member method code with example usage: obj.test_matrix_representation(tol) without return types