# Hamiltonian for a 1D spin chain [closed]

I am trying to implement the Lanczos algorithm to tridiagonalize the Hamiltonian for a 1D spin chain of length $$L$$, but I am unable to decipher from my professor's notes (here's a link), what the action the Hamiltonian has on a random vector (or for that matter what the Hamiltonian is). My touble arises at Eqn. 20 in these notes. They say that the Hamiltonian is $$\frac{1}{2}\bigg(\sum_{i=0}^{L-1}P_{ij}-\frac{L}{2}I\bigg).$$ However, this is really confusing to me since if $$P_{ij}$$ is what he defined in Eqn. 18, then the resulting matrix is just a 4 by 4 matrix and not $$2^L\times 2^L$$ as he claims it should be. If it's not the case that $$P_{ij}$$ is the same as in Eqn. 18, then what is it, and how do I compute this Hamiltonian (or at the very least) the Hamiltonian's action on a vector, $$v$$?

## closed as unclear what you're asking by Norbert Schuch, Kyle Kanos, ZeroTheHero, Jon Custer, BuzzDec 29 '18 at 2:53

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

## 1 Answer

Implicitly each of those summands is $$I^{\otimes (i-1)} \otimes P_{ij} \otimes I^{\otimes k}$$ so that each summand acts as the identity on all but two of the spins so maybe $$P_{ij}$$ is only 4 by 4 but this extension with the identity operators is actually $$2^L$$ by $$2^L$$. I put $$k$$ here just to say the rest it is something like $$L-i$$ but I may be off by 1 or 2 and didn't check which.