diagonalization of matrices with operator elements

Imagine you have a Hamiltonian, which elements are operators. For example: $$\hat{H} = -\frac{\hbar^2}{2m} \frac{d^2}{dx^2} \hat{\sigma}_z = \begin{pmatrix} \hat{p}_x/2m&0 \\ 0&-\hat{p}_x^2/2m \end{pmatrix}$$ I'm working on a project where I do some things with this Hamiltonian and this works fine as long as the Hamiltonian is diagonal. But I need the Hamitlonian in $\textbf{diagonal operator form}$.

Is it fine to just diagonalize matrices whose elements are operators?

For example: $$\hat{H} = \hat{p}_x (\hat{\sigma}_x - \hat{\sigma}_y) + m \hat{\sigma}_z + V(x) \hat{I}$$

($\hat{\sigma}_i$ are Pauli matrices).

• Are you asking if you can skip the similarity transformation process if you are given a set of operators as above, (with no other elements) or are you asking is it OK to always be able to put operators in a matrix form.? I apologise, to me your question is a little unclear. Thank you. – user108787 Oct 30 '16 at 12:32