Let $X \in \mathbb{R}^{d \times n}$ and $Y \in \mathbb{R}^{d \times m}$ have columns $x_{i}, y_{j} \in \mathbb{R}^{d}$ respectively. Is there any way to write the matrix $$\sum_{i = 1}^{n}\sum_{j = 1}^{m}x_{i}y_{j}^{\top}$$ in terms of a matrix product, say via a a Kronecker product?
I have this expression in a large calculation where I am to take derivatives w.r.t. $X$, so simplifying it would help a lot.
$$\sum_{i = 1}^n \sum_{j = 1}^m x_i y_j^\top = (\sum_{i = 1}^n x_i ) ( \sum_{j = 1}^m y_j )^\top = (X u_n) (Y u_m)^\top$$ where $u_n = (1, \dots, 1)^{\top} \in \mathbb{R}^n$