# How to do a single impurity problem with Itensor.

Hello,
I want to calculate a Hamiltonian that has an tight-binding term and a simple one magnet impurity local on one site. Therefore, the second term must be the interaction
between the impurity and the particles which has occupied on this site. So, the form is S*s.
"S" indicates the impurity spin and the "s" is the particle spin. Then,I follow the sample code and set sites=Hubbard(N), and I delete the U term in the "ampo" space and this is the first term. However, I don't know how to set the second term since the impurity spin is not belong to the "sites", actually
, I also don't know how do the particle spin term in this Hubbard sites with Itensor. So, Could anyone give me some helps?
Thank you very much!

+1 vote
answered Nov 29 by (19,810 points)

Hi, so would the following work for coupling the impurity site to the rest of your system, assuming the impurity site is site number 1?

Steps:

(1) remove the "U" term acting on site 1 when defining the AutoMPO

(2) remove the "t" hopping term connecting site 1 to any other sites (such as site 2 for a 1D chain)

(3) include the S.S interaction using the following lines:

ampo += J,"Sz",1,"Sz",2;
ampo += J/2.,"S+",1,"S-",2;
ampo += J/2.,"S-",1,"S+",2;


(If you're wondering about what is the set of operators that are defined for the Hubbard site set the complete list is here: http://itensor.org/docs.cgi?page=classes/hubbard )

Then when making the initial state (using the InitState feature), make sure there is exactly one fermion on site 1 (not zero or two fermions). The spin of this fermion shouldn't matter except for determining the overall or total Sz quantum number of your many-body wavefunction (since the dmrg code preserves the total quantum number of whatever state you use as your initial state).

Trying this out on a toy system right now where I set J=1 and all of the other couplings to zero, I get a ground state energy of -0.75 as expected for the ground state of a two-spin Heisenberg model.

If I misunderstood your question or if that doesn't work please let me know.

Best regards,
Miles

commented Nov 30 by (150 points)
Thank you so much! I will try it.