Is this a correct way to calculate one-site and two-site entanglement spectrum and entropy?

Hello everyone!

Here I want to calculate the one-site and two-site entropy to obtain the mutual information.

With the guides of these disccusion 1-RDM from Julia version - ITensor Julia Questions - ITensor Discourse, Mutual Information matrix - DMRG and Numerical Methods - ITensor Discourse and Two-site reduced density matrix - ITensor Julia Questions - ITensor Discourse, I wrote some test codes to ahieve my goal.

But nearly all of the returned eigenvalues are zero, except for one value that is close to 1 both for one-site and two-site case.

So, I want to ask is this the correct way to calculate one-site and two-site reduced density matrix and entanglement spectrum?

Here is my code:

using ITensors
using LinearAlgebra
let
sites=siteinds("Boson",6;dim=5)
psi=randomMPS(sites)
psi1=psi

@show psi1
#reduced density matrix of the 2-nd site
orthogonalize!(psi1,2)
rho2=prime(psi1[2],sites[2])*dag(psi1[2])
@show rho2

#eigenvalues and eigenvectors
D,U=eigen(rho2)
@show real(diag(D))

#two-site reduced density matrix from 2-nd site to 5-th site
psi1dag=prime(dag(psi1),linkinds(psi1))
@show psi1dag

rho25 = prime(psi1[2],linkinds(psi1,1))*prime(psi1dag[2],sites[2])
for i=3:4
 rho25 *= psi1[i]
 rho25 *= psi1dag[i]
end

rho25 *= prime(psi1[5],linkinds(psi1,5))*prime(psi1dag[5],sites[5])
@show rho25

#eigenvalues and eigenvectors
D1,U1=eigen(rho25)
@show real(diag(D1))

 return
end

Return eigenvalues are posted below:

real(diag(D)) = [-4.840131742278355e-17, -8.083711096815053e-18, 1.0651555035236634e-19, 4.440892098500626e-16, 0.9999999999999997]
real(diag(D1)) = [-7.401795436092152e-18, -4.6252031045592836e-18, -3.944402011330209e-18, -2.8644819948462954e-18, -2.6293717581260072e-18, -2.156973428240218e-18, -1.2325682057390249e-18, -8.631991377761242e-19, -8.228020911168871e-19, -6.384593619261584e-19, -4.2011674617935e-19, -5.855123893826746e-20, -2.540069963852999e-20, -1.8665081637595748e-20, -9.97283240900427e-21, 7.962122541706498e-19, 2.3282921275679494e-18, 9.0539444221301e-18, 1.790525524541232e-17, 3.1298262729536105e-17, 4.059349121268365e-17, 6.406610794074205e-17, 1.3646084663405299e-16, 1.1102230246251565e-15, 0.9999999999999982]

Best,
Wang.

2 Likes

Hi Wang,

I didn’t too closely at your code but notice that @show maxlinkdim(psi) in your example will produce 1. Here randomMPS by default creates a random product states and thus there’s no entanglement. If you do something like

psi=randomMPS(sites; linkdims=10)

then I get

real(diag(D)) = [0.07826792346639368, 0.10824296404980197, 0.17609903367909943, 0.21151369894715072, 0.4258763798575539]
real(diag(D1)) = [0.01078967878491293, 0.011473953218876853, 0.01284785676904331, 0.015386476994320936, 0.01647139182573829, 0.017035628048925895, 0.017249863272354213, 0.02072102278941376, 0.022131560746444352, 0.02415286642212064, 0.027605990585564646, 0.028342665830289177, 0.02877961982214534, 0.031538534935667016, 0.03530135098806583, 0.03913853956370359, 0.04487728360826336, 0.04622739154125704, 0.04835544761397927, 0.0555307279952805, 0.06556669737819598, 0.07317411746816042, 0.0854628095086807, 0.09949050044416612, 0.12234802384443029]
``
2 Likes