(self)
return trace
Calculate the trace of a square matrix.

        Examples
        ========

        >>> from sympy.matrices import eye
        >>> eye(3).trace()
        3
Calculate the trace of a square matrix.
Calculate the trace of a square matrix .
def _eval_trace(self):
        """Calculate the trace of a square matrix.

        Examples
        ========

        >>> from sympy.matrices import eye
        >>> eye(3).trace()
        3

        """
        trace = 0
        for i in range(self.cols):
            trace += self._mat[i*self.cols + i]
        return trace
def _eval_trace ( self ) : trace = 0 for i in range ( self . cols ) : trace += self . _mat [ i * self . cols + i ] return trace