Introducing a new generalized unitary operator - Lagrange unitary operator, which is expressed as
$M(\theta ) = \sum\limits_{j,k = 0}^{d - 1} {\frac{{\prod\nolimits_{k \ne j} {({e^{i\theta }} - {\omega ^k})} }}{{\prod\nolimits_{k \ne j} {({\omega ^j} - {\omega ^k})} }}} {U_{j,0}}$
, $\omega=e^{2\pi/d}$ and $U_{j,0}$ is generalized Pauli operator .
There is 2-dimensional Lagrange ${M}(\theta ) = \frac{1}{2}\left( {\begin{array}{*{20}{c}} {{1+e^{i\theta }}}&{1-e^{i\theta }}\\ 1-e^{i\theta }&{{1+e^{i\theta }}} \end{array}} \right)$, which denoted as: $HP(\theta)H$, and $${P}(\theta ) = \left( {\begin{array}{*{20}{c}} {{1}}&0\\ 0&{{e^{i\theta }}} \end{array}} \right)$$. Then 2-dimension Lagrange operate can be drawed in IBM Cloud platform.
I have a 4-dimension quantum gate donates as:$m(\theta)=\frac{1}{4}\left(\begin{array}{llll}1+x+x^2+x^3 & 1-i x-x^2+i x^3 & 1-x+x^2-x^3 & 1+i x-x^2-i x^3 \\ 1+i x-x^2-i x^3 & 1+x+x^2+x^3 & 1-i x-x^2+i x^3 & 1-x+x^2-x^3 \\ 1-x+x^2-x^3 & 1+i x-x^2-i x^3 & 1+x+x^2+x^3 & 1-i x-x^2+i x^3 \\ 1-i x-x^2+i x^3 & 1-x+x^2-x^3 & 1+i x-x^2-i x^3 & 1+x+x^2+x^3\end{array}\right)$, where $x=e^{i\theta}$.
Now my question is how to construct this quantum gate in IBM Cloud platform?