I need to see an example of how Hamiltonian, i.e. any Hermitian matrix, can be decomposed into a linear combination of Pauli matrices.
I would prefer an option to do this in larger than 2 dimensions, if that is possible.
I call this the "Paulinomial decomposition" as you are writing the matrix $H$ as a polynomial of Pauli matrices:
$H=a_{XX}X_1X_2 + a_{XY}X_1Y_2 +a_{XZ}X_1Z_2 + a_{XI}X_1 + a_{YY}Y_1Y_2 + \cdots $ (for the 2-qubit case).
To get the coefficients, you can use this formula:
$a_{AB}=\frac{1}{4}\textrm{tr}\left((A_1\otimes B_2)H\right)$
For example, here is a 2-qubit gate (the square root of the SWAP gate) written as a polynomial of Pauli matrices:
You can even do this for a $2^n \times 2^n$ Hamiltonian, for example an 8x8 Hamiltonian can be done like this:
$a_{ABC}=\frac{1}{8}\textrm{tr}((A_1\otimes B_2\otimes C_3)H)$
I have a code that can also do it for arbitrary matrices (not only $2^n \times 2^n$, but I haven't touched it for 2 years and might need to test it again). If it would be helpful, I can try to dig it up and polish it for you to use.
H = qutip.sigmax()
seems like it would be a possible answer to your question: it's an Hermitian matrix decomposed into a linear combination of Pauli matrices, written in python. I'm guessing you are asking for something more specific? $\endgroup$