Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Dec 2, 2023
1 parent 907092b commit c6a52bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/algorithms/expval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Compute the expectation value of an operator `O` on a state `ψ`. If `location`
operator is applied at that location. If `environments` is given, the expectation value
might be computed more efficiently by re-using previously calculated environments.
!!! note
For `MPOHamiltonian`, the expectation value is not uniquely defined, as it is unclear to
what site a given term belongs. For this reason, the returned value is half the
expectation value of all terms that start and end on the site.
# Arguments
* `ψ::AbstractMPS` : the state on which to compute the expectation value
* `O` : the operator to compute the expectation value of. This can either be an `AbstractMPO`, a single `AbstractTensorMap` or an array of `AbstractTensorMap`s.
Expand Down
5 changes: 3 additions & 2 deletions src/algorithms/toolbox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ function transfer_spectrum(above::InfiniteMPS; below=above, tol=Defaults.tol, nu
end

"""
entanglement_spectrum(ψ, site::Int=0) -> SectorDict{sectortype(ψ),Vector{<:Real}}
entanglement_spectrum(ψ; site::Int=0) -> SectorDict{sectortype(ψ),Vector{<:Real}}
Compute the entanglement spectrum at a given site, i.e. the singular values of the gauge
matrix at that site. This is a dictionary mapping the charge to the singular value.
matrix to the right of a given site. This is a dictionary mapping the charge to the singular
value.
"""
function entanglement_spectrum(st::Union{InfiniteMPS,FiniteMPS,WindowMPS}, site::Int=0)
@assert site <= length(st)
Expand Down
4 changes: 2 additions & 2 deletions src/utility/plotting.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
entanglementplot(state; site=0[, kwargs])
Plot the entanglement spectrum of a given InfiniteMPS.
Plot the entanglement spectrum of a given InfiniteMPS.
# Arguments
- `site::Int=0`: mps index for multisite unit cells.
- `site::Int=0`: mps index for multisite unit cells. Spectrum is computed for the bond between `site` and `site + 1`.
- `expand_symmetry::Logical=false`: add quantum dimension degeneracies.
- `sortby=maximum`: the method of sorting the sectors.
- `sector_margin=1//10`: the amount of whitespace between sectors.
Expand Down

0 comments on commit c6a52bb

Please sign in to comment.