# How does the Kronecker delta work for matrices?

I am trying to understand the effect of the kronecker delta function in this expression $\sum_{i,j}(1+\delta_{i,j})M_{ij}$ given that $M$ is a matrix with real-entries.

How does this operation work!?

-

The Kronecker-delta factor does a "trace," meaning a summation over the diagonal components. Remember that $\delta_{ij}=0$ if $i\ne j$. So, then for any function $f(i,j)$, you'd have $$\sum_{i,j} \delta_{ij} f(i,j) = \sum_{i=j} f(i,j) = \sum_i f(i,i)$$
In your example, then, $$\sum_{i,j} (1+\delta_{ij}) M_{ij} = \sum_{i,j} M_{ij} + \sum_i M_{ii}$$
This is a sum over all entries $M_{ij}$ of $M$, multiplying the diagonal entries $M_{ii}$ by $2$.