Skip to content

Commit c1ec1a5

Browse files
committed
added docs for evaluate_mps
1 parent 1a80ba3 commit c1ec1a5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/mpsutil.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
@doc raw"""
2+
function evaluate_mps(
3+
mps::Union{ITensors.MPS,ITensors.MPO},
4+
indexspecs::Vararg{AbstractVector{<:Tuple{ITensors.Index,Int}}}
5+
)
6+
7+
Evaluates an MPS or MPO for a given set of index values.
8+
9+
- `indexspec` is a list of tuples, where each tuple contains an `Itensors.Index` object specifying an index, and an `Int` corresponding to the value of the specified index.
10+
11+
If many evaluations are necessary, it may be advantageous to convert your MPS to a `TensorCrossInterpolation.TTCache` object first.
12+
"""
113
function evaluate_mps(
214
mps::Union{ITensors.MPS,ITensors.MPO},
315
indexspecs::Vararg{AbstractVector{<:Tuple{ITensors.Index,Int}}}
@@ -15,7 +27,20 @@ function evaluate_mps(
1527
end
1628
return scalar(V)
1729
end
30+
@doc raw"""
31+
function evaluate_mps(
32+
mps::Union{ITensors.MPS,ITensors.MPO},
33+
indices::AbstractVector{<:ITensors.Index},
34+
indexvalues::AbstractVector{Int}
35+
)
36+
37+
Evaluates an MPS or MPO for a given set of index values.
38+
39+
- `indices` is a list of `ITensors.Index` objects that specifies the order in which indices are given.
40+
- `indexvalues` is a list of integer values in the same order as `indices`.
1841
42+
If many evaluations are necessary, it may be advantageous to convert your MPS to a `TensorCrossInterpolation.TTCache` object first.
43+
"""
1944
function evaluate_mps(
2045
mps::Union{ITensors.MPS,ITensors.MPO},
2146
indices::AbstractVector{<:ITensors.Index},

0 commit comments

Comments
 (0)