In other words, how would you write this equation in a formal mathematics format appropriate for a discussion in matrix algebra?
D=Partition[Flatten[Tuples[Reverse[IdentityMatrix[a]],w]],(a*w)]