That `k` comes from here, no?

    Y = MatrixSymbol('Y', m, k)