I was working through a new econometric estimator and found that it made extensive usage of matrix vectorization operators like vech and moving between vec and vech. I could not find implementations of them anywhere so I spent a morning coding them up and have split them off into a package for convenience: VectorizationsTransformations.jl
Specifically it implements
vechVectorization (mathematics) - Wikipediaduplication_matrixandelimination_matrixDuplication and elimination matrices - Wikipediacommutation_matrixCommutation matrix - Wikipediasymmetrizer_matrix
The matrices are explicitly constructed and sparse. I think optimized routines probably avoid using these sorts of things altogether, but for the “math as code” strict implementations I found them quite useful.