Skip to content

Commit

Permalink
Typos and format
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Oct 4, 2023
1 parent 70ca954 commit 5dff15d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/operators/mpomultiline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ See also: [`Multiline`](@ref), [`SparseMPO`](@ref), [`DenseMPO`](@ref)
"""
const MPOMultiline = Multiline{<:Union{SparseMPO,DenseMPO}}

function MPOMultiline(Os::AbstractMatrix{<:MPOTensor})
return MPOMultiline(data, map(DenseMPO, eachrow(Os)))
end
MPOMultiline(Os::AbstractMatrix{<:MPOTensor}) = MPOMultiline(map(DenseMPO, eachrow(Os)))
MPOMultiline(mpos::AbstractVector{<:Union{SparseMPO,DenseMPO}}) = Multiline(mpos)
MPOMultiline(t::MPOTensor) = MPOMultiline(fill(t, 1, 1))

Expand Down
9 changes: 6 additions & 3 deletions src/states/mpsmultiline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ See also: [`Multiline`](@ref)
"""
const MPSMultiline = Multiline{<:InfiniteMPS}
MPSMultiline(mpss::AbstractVector{<:InfiniteMPS}) = Multiline(mpss)
function MPSMultiline(pspaces::AbstractMatrix{S}, Dspaces::AbstractMatrix{S}; kwargs...) where {S<:VectorSpace}
function MPSMultiline(

Check warning on line 21 in src/states/mpsmultiline.jl

View check run for this annotation

Codecov / codecov/patch

src/states/mpsmultiline.jl#L21

Added line #L21 was not covered by tests
pspaces::AbstractMatrix{S}, Dspaces::AbstractMatrix{S}; kwargs...
) where {S<:VectorSpace}
data = map(eachrow(pspaces), eachrow(Dspaces)) do (p, D)
return InfiniteMPS(p, D; kwargs...)

Check warning on line 25 in src/states/mpsmultiline.jl

View check run for this annotation

Codecov / codecov/patch

src/states/mpsmultiline.jl#L24-L25

Added lines #L24 - L25 were not covered by tests
end
Expand All @@ -30,8 +32,9 @@ function MPSMultiline(As::AbstractMatrix{T}; kwargs...) where {T<:GenericMPSTens
end
return MPSMultiline(data)
end
function MPSMultiline(ALs::AbstractMatrix{<:GenericMPSTensor},
C₀::AbstractVector{<:MPSBondTensor}; kwargs...)
function MPSMultiline(
ALs::AbstractMatrix{<:GenericMPSTensor}, C₀::AbstractVector{<:MPSBondTensor}; kwargs...
)
data = map(eachrow(ALs), C₀) do ALrow, C₀row
return InfiniteMPS(ALrow, C₀row; kwargs...)
end
Expand Down
1 change: 1 addition & 0 deletions src/utility/multiline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ function Base.circshift(A::Multiline, shifts::Tuple{Int,Int})
return Multiline(circshift!(data′, shifts[1]))

Check warning on line 39 in src/utility/multiline.jl

View check run for this annotation

Codecov / codecov/patch

src/utility/multiline.jl#L36-L39

Added lines #L36 - L39 were not covered by tests
end
Base.reverse(A::Multiline) = Multiline(reverse(parent(A)))

Check warning on line 41 in src/utility/multiline.jl

View check run for this annotation

Codecov / codecov/patch

src/utility/multiline.jl#L41

Added line #L41 was not covered by tests
Base.only(A::Multiline) = only(parent(A))
2 changes: 1 addition & 1 deletion src/utility/utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ end
# check all elements are equal -> only defined in 1.8+
@static if !isdefined(Base, :allequal)
allequal(itr) = isempty(itr) ? true : all(isequal(first(itr)), itr)

Check warning on line 144 in src/utility/utility.jl

View check run for this annotation

Codecov / codecov/patch

src/utility/utility.jl#L144

Added line #L144 was not covered by tests
end
end

0 comments on commit 5dff15d

Please sign in to comment.