Quantum number flux

Hey all,
I am trying to do Hermitian diagonlization to an mpo. I saw in the documentation of c++ that there is some option to it, but I couldn’t find a way in Julia. Does anyone know how to achieve this goal ?
Any way if it is helpful for understanding, what I am trying to do is to take and MPO which is my Hamiltonian, and to get it’s eigenvalues, and eigenvectors (which will be his wave functions).
** Another question I about svd and eigen . When I applied the svd function of ITensors I got “x” elements on the S matrix, while in eigen I got “y” different elements. Isn’t those elements should be the same? (up to squaring the “x” elements ? ) let’s say that x is 10 and y is 16.
Thank you all,
Tomer

Hi Tomer,
Yes so if you have an MPO and you want to find its eigenvalues and eigenvectors, this is precisely what the DMRG algorithm is for. The usual “ground state” DMRG algorithm finds the extremal (most negative) eigenvalue (= ground-state energy) and associated eigenvector. Then you can use “excited state DMRG” or the DMRG-X algorithm which is supported in our new ITensorTDVP package to find higher excited states (other eigenvectors). Does that answer your question?

For your other question, I’m not sure why you got a different number of singular values versus eigenvalues. Did you use exactly the same truncation parameters (maxdim, cutoff)? If you did and still get different results, it could be a bug and we would need a minimal code example that reproduces it to be able to fix it - thanks.

I will show a code example, but I am pretty sure that I had a mistake on the truncation.

using ITensors
n=4 
site= siteinds("Qubit",n)
J=random(n)
H= MPO(H_model,site)
U , S, V= svd(H[2], (linkind(H,1), siteind(H,2))
m=1 
for I=1: length(H)
m=m*H[I]
end 
E,B = eigen(m) 
# E ≠ S

I think that this is because I sliced S from top to bottom, but E from left to right.
But this is now answering the question why E has 10 elements and S has 16.
Tomer

I see - thanks for letting me know what happened & posting the code. Glad you figured it out!