Skip to content

Commit 4d975c0

Browse files
change default site value for FiniteMPS in entanglement_spectrum (#245)
* change default site value for `FiniteMPS` in `entanglement_spectrum` * change `entanglement_spectrum` docstring
1 parent 37a5fac commit 4d975c0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/algorithms/toolbox.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,21 @@ function transfer_spectrum(above::InfiniteMPS; below=above, tol=Defaults.tol, nu
8686
end
8787

8888
"""
89-
entanglement_spectrum(ψ, [site::Int=0]) -> SectorDict{sectortype(ψ),Vector{<:Real}}
89+
entanglement_spectrum(ψ, site::Int) -> SectorDict{sectortype(ψ),Vector{<:Real}}
9090
9191
Compute the entanglement spectrum at a given site, i.e. the singular values of the gauge
9292
matrix to the right of a given site. This is a dictionary mapping the charge to the singular
9393
values.
94+
95+
For `InfiniteMPS` and `WindowMPS` the default value for `site` is 0.
96+
97+
For `FiniteMPS` no default value for `site` is given, it is up to the user to specify.
9498
"""
95-
function entanglement_spectrum(st::Union{InfiniteMPS,FiniteMPS,WindowMPS}, site::Int=0)
99+
function entanglement_spectrum(st::Union{InfiniteMPS,WindowMPS}, site::Int=0)
100+
checkbounds(st, site)
101+
return LinearAlgebra.svdvals(st.C[site])
102+
end
103+
function entanglement_spectrum(st::FiniteMPS, site::Int)
96104
checkbounds(st, site)
97105
return LinearAlgebra.svdvals(st.C[site])
98106
end

0 commit comments

Comments
 (0)