Solution (source code)

= Solution

For a two-by-two matrix over a <principal ideal domain>, its first <Smith normal form> invariant is the <greatest common divisor> of its entries, while the product of its two invariants is its <determinant>, up to a unit. Here
$$
1=3-(1-i)(1+i),
$$
so the entries generate the unit ideal in the <Gaussian integers>. The first invariant is therefore $1$. Also
$$
\det B=3(1+i)-(2+2i)(5+2i)=-3-11i.
$$
Hence a valid <Smith normal form> is
$$
\boxed{\begin{pmatrix}1&0\\0&-3-11i\end{pmatrix}.}
$$
Multiplying the second diagonal entry by a unit $\pm1,\pm i$ gives an equivalent normal form. The divisibility condition holds because $1$ divides every <Gaussian integer>.