Skip to content

Commit 9b27b70

Browse files
formatter
1 parent 7b879b5 commit 9b27b70

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/states/finitemps.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ struct FiniteMPS{A<:GenericMPSTensor,B<:MPSBondTensor} <: AbstractFiniteMPS
5858
function FiniteMPS{A,B}(ALs::Vector{Union{Missing,A}}, ARs::Vector{Union{Missing,A}},
5959
ACs::Vector{Union{Missing,A}},
6060
Cs::Vector{Union{Missing,B}}) where {A<:GenericMPSTensor,
61-
B<:MPSBondTensor}
61+
B<:MPSBondTensor}
6262
return new{A,B}(ALs, ARs, ACs, Cs)
6363
end
6464
function FiniteMPS(ALs::Vector{Union{Missing,A}}, ARs::Vector{Union{Missing,A}},
6565
ACs::Vector{Union{Missing,A}},
6666
Cs::Vector{Union{Missing,B}}) where {A<:GenericMPSTensor,
67-
B<:MPSBondTensor}
67+
B<:MPSBondTensor}
6868
length(ACs) == length(Cs) - 1 == length(ALs) == length(ARs) ||
6969
throw(DimensionMismatch("length mismatch of tensors"))
7070
sum(ismissing.(ACs)) + sum(ismissing.(Cs)) < length(ACs) + length(Cs) ||
@@ -161,7 +161,7 @@ function center(ψ::FiniteMPS)::HalfInt
161161
if isnothing(center)
162162
center = findfirst(!ismissing, ψ.Cs)
163163
isnothing(center) && throw(ArgumentError("No center found, invalid state"))
164-
return (center - 1/2)
164+
return (center - 1 / 2)
165165
end
166166
isnothing(center) && throw(ArgumentError("No center found, invalid state"))
167167
return center
@@ -494,7 +494,7 @@ function TensorKit.norm(ψ::FiniteMPS)
494494
if isinteger(c) # center is an AC
495495
return norm.AC[Int(c)])
496496
else # center is a bond-tensor
497-
return norm.C[Int(c - 1/2)])
497+
return norm.C[Int(c - 1 / 2)])
498498
end
499499
end
500500
TensorKit.normalize!::FiniteMPS) = rmul!(ψ, 1 / norm(ψ))

src/states/infinitemps.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct InfiniteMPS{A<:GenericMPSTensor,B<:MPSBondTensor} <: AbstractMPS
5252
AR::PeriodicVector{A},
5353
C::PeriodicVector{B},
5454
AC::PeriodicVector{A}=AL .* C) where {A<:GenericMPSTensor,
55-
B<:MPSBondTensor}
55+
B<:MPSBondTensor}
5656
# verify lengths are compatible
5757
L = length(AL)
5858
L == length(AR) == length(C) == length(AC) ||
@@ -67,7 +67,7 @@ struct InfiniteMPS{A<:GenericMPSTensor,B<:MPSBondTensor} <: AbstractMPS
6767
AR::PeriodicVector{A},
6868
C::PeriodicVector{B},
6969
AC::PeriodicVector{A}=AL .* C) where {A<:GenericMPSTensor,
70-
B<:MPSBondTensor}
70+
B<:MPSBondTensor}
7171
# verify lengths are compatible
7272
L = length(AL)
7373
L == length(AR) == length(C) == length(AC) ||
@@ -109,7 +109,7 @@ Constructors
109109

110110
function InfiniteMPS(AL::AbstractVector{A}, AR::AbstractVector{A}, C::AbstractVector{B},
111111
AC::AbstractVector{A}=AL .* C) where {A<:GenericMPSTensor,
112-
B<:MPSBondTensor}
112+
B<:MPSBondTensor}
113113
return InfiniteMPS(convert(PeriodicVector{A}, AL), convert(PeriodicVector{A}, AR),
114114
convert(PeriodicVector{B}, C), convert(PeriodicVector{A}, AC))
115115
end

src/states/orthoview.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ function Base.setindex!(v::ACView{<:Multiline}, vec, i::Int, j::Int)
155155
return setindex!(v.parent[i].AC, vec, j)
156156
end
157157

158+
# function Base.getindex(A::AbstractArray, hi::HalfInteger)
159+
# if isinteger(hi)
160+
# return getindex(A, Int(hi))
161+
# else
162+
# throw(ArgumentError("Indexing a $(typeof(A)) with half-odd-integer indices is not supported"))
163+
# end
164+
# end
165+
158166
#--- define the rest of the abstractarray interface
159167
Base.size(psi::Union{ACView,ALView,ARView}) = size(psi.parent)
160168

0 commit comments

Comments
 (0)