In general, if $T$ is a matrix, then $T^2 = T \cdot T$ (matrix multiplication).
What you are doing is the Hadamard Product.
Also, summing the rows of a matrix is equivalant to multiplying the matrix by a column vector of all $1$'s.
In general, if $T$ is a matrix, then $T^2 = T \cdot T$ (matrix multiplication).
What you are doing is the Hadamard Product.
Also, summing the rows of a matrix is equivalant to multiplying the matrix by a column vector of all $1$'s.