Skip to content

Commit 8d81541

Browse files
committed
update docstrings
1 parent d6f1310 commit 8d81541

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/operators/mpo.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,17 @@ function Base.isapprox(
391391
return norm₁₂² max(atol^2, rtol^2 * max(norm₁², norm₂²))
392392
end
393393

394-
"""
394+
@doc """
395395
swap(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=SDD(), trscheme)
396396
swap!(mpo::FiniteMPO, i::Integer; inv::Bool=false, alg=SDD(), trscheme)
397397
398398
Compose the mpo with a swap gate applied to indices `i` and `i + 1`, effectively creating an
399399
operator that acts on the Hilbert spaces with those factors swapped.
400400
The keyword arguments `alg` and `trscheme` can be used to control how the resulting tensor
401401
is truncated again.
402-
"""
403-
swap(mpo::FiniteMPO{<:MPOTensor}, i::Integer; kwargs...) = swap!(copy(mpo), i; kwargs...)
402+
""" swap, swap!
403+
404+
swap(mpo::FiniteMPO, i::Integer; kwargs...) = swap!(copy(mpo), i; kwargs...)
404405
function swap!(
405406
mpo::FiniteMPO{<:MPOTensor}, i::Integer;
406407
inv::Bool = false,
@@ -423,6 +424,15 @@ function swap!(
423424
return mpo
424425
end
425426

427+
@doc """
428+
multiply_neighbours(mpo::FiniteMPO, i::Integer)
429+
multiply_neighbours!(mpo::FiniteMPO, i::Integer)
430+
431+
Construct the mpo of length `length(mpo) - 1` which is formed by multiplying the operators
432+
on site `i` and `i + 1`.
433+
""" multiply_neighbours, multiply_neighbours!
434+
435+
multiply_neighbours(mpo::FiniteMPO, i::Integer) = multiply_neighbours!(copy(mpo), i)
426436
function multiply_neighbours!(mpo::FiniteMPO{<:MPOTensor}, i::Integer)
427437
1 <= i < length(mpo) || throw(BoundsError(mpo, i))
428438
O₁ = mpo[i]

0 commit comments

Comments
 (0)