about initializing MPS

Hello there,
I have a quick question about initializing MPS for a system with two types of sites. So I have both electron type sites and S=1/2 type sites (an effective spin degree of freedom, not electons’ spin but have all properties as usual 1/2 spin). And I’ve conserve_qns=true for electron and no symmetry conservation for pseudospin. What I want to do is, I want my initial MPS has random density distribution on electron sites with a fixed sum equal to some number N (e.g. 1,0,2,1,1,0,…), and staggered pattern for my pseudospin (e.g. Up, Dn, Up, Dn,…). I know psi0 = randomMPS(sites, state, 10) can give me random MPS and psi0 = productMPS(sites, state) can give me staggered MPS. But I’m not very sure how to use them together in my situation for syntex perpective. Could you give some suggestion? Thank you so much!!

Here is my current code using productMPS (I hope this helps to clarify my question a little bit…)

	  state = ["Emp" for n in 1:3N]
	  p = Npart
      # pseudospin 1
 	  for i in 2N+1:3N
 	      state[i] = (isodd(i) ? "Up" : "Dn")
 	  end
      # pseudospin 2
	  for i in N+1:2N
 	      state[i] = (isodd(i) ? "Dn" : "Up")
 	  end
      # electon sites
 	  for i in 1:2:N
 	    if p > 0 
 	        println("Doubly occupying site $i")
 	        state[i] = "UpDn"
 	        p -=2
 	    end
 	   
psi0 = productMPS(sites, state) 

And I’m trying to find a way using productMPS only for N+1~3N sites, and randomMPS for 1~N electron sites. Could you help to see how to do this kind of set up? Thank you so much!

Hi Kristin,
Thanks for your patience on the slow reply. So the way to do this kind of custom thing would be to define the MPS tensors individually. But you could use the existing ITensor MPS constructors (like randomMPS) to help. So the steps I’d recommend would be:

  1. make a sites array (returned from siteinds) just for your electron sites and use randomMPS to make a random MPS for those sites

  2. make a second sites array of your pseudospin sites

  3. merge these two arrays together by alternating through both and putting the electron site indices into the odd sites and the spin site indices into the even sites

  4. make a new MPS psi which is defined on this site array

  5. set the tensors one-by-one of this new MPS, so for the electron sites just set the tensors to be the ones from your random MPS. For the psedospin sites, make the MPS tensor an outer product of a vector which carries the site index and is set to the state you want, and an identity operator which just connects the link index from the previous electron MPS tensor to the next electron MPS tensor.

I hope that is clear enough and let me know if you have any questions about it.

You may need to do some reindexing of the link indices using the delta ITensor to make things connect correctly in the final MPS.