questions about metts

Hi there

My questions are very basic, they are related to the example of METTS.

  1. There is a line in example, which is
      new_state = [samp[j] == 1 ? "X+" : "X-" for j in 1:N]

Is that mean new_state is the maximally mixed state?

  1. For boson, do we have to choose the basis under two axes in order to collapse METTS to product state ? If we need, how to define a Ry_gates ? If we do not need to do that, I try to define a N_gates which corresponds to Ry_gates ,
      s = siteinds("Boson", L)
      N_gates = ops([("N", n) for n in 1:L], s)

Did I write correctly?

Best
Yuanyu

Maybe I should map the Boson Hubbard model to Heisenberg model. Then I could set the system which is S=1.

I have tried to print the 3D rotation gates , which is

ITensors.op(::OpName"RotateY",::SiteType"S=1") = [cos(pi/2) 0 sin(pi/2); 0 1 0; -sin(pi/2) 0 cos(pi/2)]

I am going to test if that is the right way.

Hi Yuanyu,
The state new_state you defined above will make an array of strings that you can pass to the ITensor MPS constructor to make a product state. That product state MPS will then have spins in the +x direction on sites where samp[j]==1 and in the -x direction on sites where samp[j] != 1. So it will be a product state of spins in the +x and -x direction based on what properties the previous sample has. (I would have to review the code to remember how samp is defined.) I’m not sure what you mean by maximally mixed state.

About rotations such as Ry, you can read about which operators are defined for the S=1/2 (same as Qubit) and the S=1 site types here:
https://itensor.github.io/ITensors.jl/dev/IncludedSiteTypes.html#"S1/2"-SiteType

For examples of using these operators when they take arguments such as θ, you can look in the examples folder of the ITensors.jl source code or ask us if you can’t find such an example. There are other ways to make rotations to collapse METTS into different bases e.g. one way would be to define your own operators.

That’s good you are trying making your own operators which can be the easiest way sometimes. Try next making your operator into an ITensor and printing out its elements to confirm it worked correctly.

Hey miles

Thanks for your reply. I still have some doubts about “gates” and function “sample!”. Here is my minimal runable code

function ITensors.op(::OpName"expτSS9", ::SiteType"Boson", n1::Index, n2::Index; τ)
  h =
   t * op("Adag", n1) * op("A", n2) + 
   t * op("Adag", n2) * op("A", n1) - 
   U2/2 * op("N * N", n1) * op("Id", n2) + 
   U2/2 * op("N", n1) * op("Id", n2) - 
   V2 * op("N", n1) * op("N", n2) - 
   miu2 * op("N", n1) * op("Id", n2)
  return exp(τ * h)
end

  so = siteinds("Boson", N, dim=3)

gates10 = ops([("expτSS9", (n, n + 1), (τ=-δτ / 2,)) for n in 1:(N - 1)], so)

append!(gates10, reverse(gates10));

psi = randomMPS(so)

τ_range = δτ:δτ:(beta / 2)

for τ in τ_range
  psi10 = apply(gates10, psi10; cutoff)
  normalize!(psi10)
  @show sample!(psi10)
end

There is not indicate an error, but the output of this part of code is

sample!(psi10) = [3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 2, 2, 1, 3, 2, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 2]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 2]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
sample!(psi10) = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]

I do not know the number 3 refers to whether the number of particles per site is 0 or 2. Why is psi10 like this?

Yuanyu

Ooops, Did I missed the “im”?