
\documentclass{article}
\usepackage{amsmath}
\pagestyle{empty}
\DeclareMathOperator*{\diag}{diag}
\begin{document}
\[\diag_1^n \]
\end{document}
