eigenvectors for an ITensor object

Hey all,

I saw in the documentation that there is a possibility to use the eigen function in order to decompose an ITensor for it’s eigenvalues and eigenvectors.
My question is how to read the ITensor of the eigenvectors I am getting back?
And also, how is the best way to slice a MPO in order to get it’s actual eigenvectors?

Also, is it true that in ITensor object the first element corresponds to the up state in the computational basis ?

Basically what I am trying to do is to get the eigenvectors of my Hamiltonian in order to create a Boltzmann ensemble.

Hope the questions where clear.

1 Like

Does someone knows and can help ?

Hi tsegev, Thanks for the question. In the examle here: ITensor · ITensors.jl

the eigen call returns two ITensors. D is the eigen values and U holds the eigen vectors. You can look inside each by using the @show macro
@show D U

The details of the layout for the eigen vectors depends on how you set up the indices in the input (A) and how you arrange Linds and Rinds. If you post your code then we can help with specifics. I hope this helps.

1 Like

Hi Jan
thank you for your reply.
I looked into D,U. but I did not understood the results.

The H I am trying to get his eigenvectors is: H=\sum_{(I>j),\alpha \beta}^{(N-1,N),z}JS_i^{\alpha}S_j^{\beta}.

The obvious thing to do will be to separate the prime and not primes indices, but I want to know what the mixture of them will give.
For example (assuming we already created the MPO):

n=3 
site=siteinds("Qubit",n)
H=MPO(os,site)
h=prod(H)
Linds = (site[1]', site[2],site[3]')
Rinds = (site[1], site[2]',site[3])
D,U= eigen(h)
d,u=eigen(h,Rinds,Linds)

I don’t see any difference in the eigenvalues, nor in the eigenvectors.
So, what the seperation for right and left will change, and what is the reason to separate to begin with ?

Also, is it true that in ITensor object the first element corresponds to the up state in the computational basis ?

Hy Jan,
Waiting for your reply

Hi tsegev, Sorry for the delay. If you can post a complete code segment (including the MPO function) for a small system (n=3 looks good). Then I can run it an maybe add some @show statements to clarify what is happening.

Kind Regards
Jan

Yes of course!
Thank you for your reply

n=3
    Q=[]
    temp=1
    for j=1:(n-1)
        for i=(j+1):n
            for α= 1:3
                for β= 1:3
                    Q=push!(Q,temp)
                    temp=temp+1
                end
            end
        end
    end
    temp=1
    J= randn(length(Q))
site=siteinds("Qubit",n)
    g= randn(n-1)
    os = OpSum()
    temp = 1
    A = ["Sx", "Sy", "Sz"]
    for j in 1:n-2
        for i in j+1:n-1
            for α in 1:3
                for β in 1:3
                    os += J[temp], A[α], j, A[β], i
                    temp = temp + 1
                end
            end
        end
    end
    H_syk=MPO(os, site)

This is the MPO, and the code above is the next step to diagonalize it.

I hope this helps.

h=prod(H_syk) #this is an order 6 tensor.  It must the rendered down ot order=2 for eigen decomposition.
# Under the hood eigen() combines all the primed indices into the left index, and all the unprimed
# indices into a right index.  It then eigen decomposes this 8x8 matrix.  Before returning
# it "un-combines the non-primed indices back into the thier original 2x2x2 structure.
# It does not return U' because you can make the yourself.
D,U= eigen(h) 
@show inds(U) #see all d=2 site indices.
Uc=U*combiner(site[1], site[2],site[3]) #Combine 2x2x2 into an dim=8 index
@show inds(Uc) #Creates a dim=8 "CMB,Link" index

display(matrix(Uc)[2,:]) #Show the second row as an eigen vector
U1=matrix(Uc)[1,:]
U2=matrix(Uc)[2,:]
@show transpose(U1)*U2 #Are they orthogonal?
#
#  In this case you are telling the eigen routine how to combine the indices to make a matrix
#
Linds = (site[1]', site[2],site[3]')
Rinds = (site[1], site[2]',site[3])
d,u=eigen(h,Linds,Rinds)
@show inds(u) #u has the Rinds indices. 
uc=u*combiner(Rinds)
@show inds(uc)
u1=matrix(uc)[3,:] #get the 3rd eigen vector.

Hey, JanReimers
Thank you for your reply!

Just to be sure, this line is to create a projector into the eigenvector itself ?

Uc=U*combiner(site[1], site[2],site[3])

In diagrams the combiner does this
||| … |
h → h
||| … |

where the three vertical lines on upper left are the site indices.
The eigen vector is selected using the common index between D and U. Without the combiner the eight elements of that eigen vector are selected by choosing values {1,2}x{1,2}x{1,2} for the three site indices. After combining you can selects element inside the eigen vector by simply indexing from 1 to 8. So just two representations of the same thing.

Thank you very much for all your help!

1 Like