class_docstr: Tests for the QubitSum operator
docstr: Test the adjoint method of QubitSum by reconstructing the unitary matrix and checking
  if it is equal to qml.QubitSum's matrix representation (recall that the operation is self-adjoint)
docstr_tok: ["Test","the","adjoint","method","of","QubitSum","by","reconstructing","the","unitary","matrix","and","checking","if","it","is","equal","to","qml.QubitSum","'s","matrix","representation","(","recall","that","the","operation","is","self-adjoint",")"]
code: def test_adjoint(self):
      """Test the adjoint method of QubitSum by reconstructing the unitary matrix and checking
      if it is equal to qml.QubitSum's matrix representation (recall that the operation is self-adjoint)
      """
      dev = qml.device("default.qubit", wires=3)
  
      @qml.qnode(dev)
      def f(state):
          qml.StatePrep(state, wires=range(3))
          qml.adjoint(qml.QubitSum)(wires=range(3))
          return qml.probs(wires=range(3))
  
      u = np.array([f(state) for state in np.eye(2**3)]).T
      assert np.allclose(u, qml.QubitSum.compute_matrix())
  
imports: import copy
  import itertools
  import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestQubitSum obj's underlying member method code with example usage: obj.test_adjoint() and returns: qml