class_docstr: A base class for operators that are composed of other operators.
  
  Args:
      operands: (tuple[~.operation.Operator]): a tuple of operators which will be combined.
  
  Keyword Args:
      id (str or None): id for the operator. Default is None.
  
  The child composite operator should define the `_op_symbol` property
  during initialization and define any relevant representations, such as
  :meth:`~.operation.Operator.matrix` and :meth:`~.operation.Operator.decomposition`.
docstr: Sequence of gates that diagonalize the operator in the computational basis.
  
  Given the eigendecomposition :math:`O = U \Sigma U^{\dagger}` where
  :math:`\Sigma` is a diagonal matrix containing the eigenvalues,
  the sequence of diagonalizing gates implements the unitary :math:`U^{\dagger}`.
  
  The diagonalizing gates rotate the state into the eigenbasis
  of the operator.
  
  A ``DiagGatesUndefinedError`` is raised if no representation by decomposition is defined.
  
  .. seealso:: :meth:`~.Operator.compute_diagonalizing_gates`.
  
  Returns:
      list[.Operator] or None: a list of operators
docstr_tok: ["Sequence","of","gates","that","diagonalize","the","operator","in","the","computational","basis",".","Given","the","eigendecomposition",":","math",":","`","O","=","U","\\Sigma","U^","{","\\dagger","}","`","where",":","math",":","`","\\Sigma","`","is","a","diagonal","matrix","containing","the","eigenvalues",",","the","sequence","of","diagonalizing","gates","implements","the","unitary",":","math",":","`","U^","{","\\dagger","}","`",".","The","diagonalizing","gates","rotate","the","state","into","the","eigenbasis","of","the","operator",".","A","``","DiagGatesUndefinedError","``","is","raised","if","no","representation","by","decomposition","is","defined",".","..","seealso",":",":",":","meth",":","`","~.Operator.compute_diagonalizing_gates","`",".","Returns",":","list","[",".Operator","]","or","None",":","a","list","of","operators"]
code: def diagonalizing_gates(self):
      r"""Sequence of gates that diagonalize the operator in the computational basis.
  
      Given the eigendecomposition :math:`O = U \Sigma U^{\dagger}` where
      :math:`\Sigma` is a diagonal matrix containing the eigenvalues,
      the sequence of diagonalizing gates implements the unitary :math:`U^{\dagger}`.
  
      The diagonalizing gates rotate the state into the eigenbasis
      of the operator.
  
      A ``DiagGatesUndefinedError`` is raised if no representation by decomposition is defined.
  
      .. seealso:: :meth:`~.Operator.compute_diagonalizing_gates`.
  
      Returns:
          list[.Operator] or None: a list of operators
      """
      diag_gates = []
      for ops in self.overlapping_ops:
          if len(ops) == 1:
              diag_gates.extend(ops[0].diagonalizing_gates())
          else:
              tmp_sum = self.__class__(*ops)
              eigvecs = tmp_sum.eigendecomposition["eigvec"]
              diag_gates.append(
                  qml.QubitUnitary(
                      eigvecs.conj().T, wires=tmp_sum.wires
                  )
              )
      return diag_gates
  
imports: import abc
  from typing import Callable, List
  import copy
  import numpy
  import pennylane
  from pennylane import math
  from pennylane.operation import Operator, convert_to_opmath, _UNSET_BATCH_SIZE
  from pennylane.wires import Wires
label_desc: Use image node_id 23 for calling the CompositeOp obj's underlying member method code with example usage: obj.diagonalizing_gates() and returns: diag_gates