Recently graduated math student here. The definition of the "vec" operator which turns a matrix into a vector works like this, stacking up columns rather than rows.

https://en.wikipedia.org/wiki/Vectorization_(mathematics)