Skip to content

Commit b4b916d

Browse files
committed
some reorganization
1 parent e6ac2ce commit b4b916d

File tree

5 files changed

+222
-212
lines changed

5 files changed

+222
-212
lines changed

src/MPSKit.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ include("operators/projection.jl")
123123
include("operators/timedependence.jl")
124124
include("operators/multipliedoperator.jl")
125125
include("operators/lazysum.jl")
126-
include("operators/show.jl")
127126

128127
include("transfermatrix/transfermatrix.jl")
129128
include("transfermatrix/transfer.jl")
@@ -189,6 +188,8 @@ include("algorithms/ED.jl")
189188

190189
include("algorithms/unionalg.jl")
191190

191+
include("utility/show.jl")
192+
192193
function __init__()
193194
Defaults.set_scheduler!()
194195
return nothing

src/operators/show.jl

Lines changed: 0 additions & 116 deletions
This file was deleted.

src/states/finitemps.jl

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -439,65 +439,6 @@ Compute the dimension of the maximal virtual space at a given site.
439439
"""
440440
max_Ds::FiniteMPS) = dim.(max_virtualspaces(ψ))
441441

442-
function Base.summary(io::IO, ψ::FiniteMPS)
443-
L = length(ψ)
444-
D = maximum(dim, left_virtualspace(ψ))
445-
return print(io, "$L-site FiniteMPS ($(scalartype(ψ)), $(TensorKit.type_repr(spacetype(ψ)))) maxdim: ", D, "\tcenter: ", ψ.center)
446-
end
447-
function Base.show(io::IO, ::MIME"text/plain", ψ::FiniteMPS)
448-
summary(io, ψ)
449-
get(io, :compact, false)::Bool && return nothing
450-
451-
println(io, ":")
452-
io = IOContext(io, :typeinfo => spacetype(ψ))
453-
454-
limit = get(io, :limit, true)::Bool
455-
half_screen_rows = limit ? div(displaysize(io)[1] - 2, 4) : typemax(Int)
456-
L = length(ψ)
457-
if L <= 2 * half_screen_rows # everything fits!
458-
half_screen_rows = typemax(Int)
459-
end
460-
461-
# special handling of edge spaces => don't print if trivial
462-
Vright = right_virtualspace(ψ, L)
463-
right_trivial = Vright == oneunit(Vright)
464-
Vleft = left_virtualspace(ψ, 1)
465-
left_trivial = Vleft == oneunit(Vleft)
466-
467-
468-
right_trivial || println(io, "", Vright)
469-
for i in reverse(1:L)
470-
if i > L - half_screen_rows
471-
if i == L
472-
connector = right_trivial ? "" : ""
473-
println(io, connector, "─[$i]─ ", physicalspace(ψ, i))
474-
elseif i == 1
475-
connector = left_trivial ? "" : ""
476-
println(io, connector, "─[$i]─ ", physicalspace(ψ, i))
477-
else
478-
println(io, "├─[$i]─ ", physicalspace(ψ, i))
479-
end
480-
481-
i != 1 && println(io, "", left_virtualspace(ψ, i))
482-
elseif i == half_screen_rows
483-
println(io, "│ ⋮")
484-
elseif i < half_screen_rows
485-
i != L && println(io, "", right_virtualspace(ψ, i))
486-
if i == L
487-
connector = right_trivial ? "" : ""
488-
println(io, connector, "─[$i]─ ", physicalspace(ψ, i))
489-
elseif i == 1
490-
connector = left_trivial ? "" : ""
491-
println(io, connector, "─[$i]─ ", physicalspace(ψ, i))
492-
else
493-
println(io, "├─[$i]─ ", physicalspace(ψ, i))
494-
end
495-
end
496-
end
497-
left_trivial || println(io, "", Vleft)
498-
499-
return nothing
500-
end
501442

502443
#===========================================================================================
503444
Linear Algebra

src/states/infinitemps.jl

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -311,42 +311,6 @@ function Base.isapprox(ψ₁::InfiniteMPS, ψ₂::InfiniteMPS; kwargs...)
311311
return isapprox(dot(ψ₁, ψ₂), 1; kwargs...)
312312
end
313313

314-
function Base.summary(io::IO, ψ::InfiniteMPS)
315-
D = maximum(dim, left_virtualspace(ψ))
316-
L = length(ψ)
317-
return print(io, "$L-site InfiniteMPS ($(scalartype(ψ)), $(TensorKit.type_repr(spacetype(ψ)))) maxdim: ", D)
318-
end
319-
320-
function Base.show(io::IO, ::MIME"text/plain", ψ::InfiniteMPS)
321-
summary(io, ψ)
322-
get(io, :compact, false)::Bool && return nothing
323-
324-
println(io, ":")
325-
io = IOContext(io, :typeinfo => eltype(ψ))
326-
327-
limit = get(io, :limit, true)::Bool
328-
half_screen_rows = limit ? div(displaysize(io)[1] - 6, 4) : typemax(Int)
329-
L = length(ψ)
330-
if L <= 2 * half_screen_rows # everything fits!
331-
half_screen_rows = typemax(Int)
332-
end
333-
334-
println(io, "| ⋮")
335-
println(io, "| ", right_virtualspace(ψ, L))
336-
for i in reverse(1:L)
337-
if i > L - half_screen_rows || i < half_screen_rows
338-
println(io, "├─[$i]─ ", physicalspace(ψ, i))
339-
println(io, "", left_virtualspace(ψ, i))
340-
elseif i == half_screen_rows
341-
println(io, "│ ⋮")
342-
println(io, "", left_virtualspace(ψ, i))
343-
end
344-
end
345-
println(io, "| ⋮")
346-
347-
return nothing
348-
end
349-
350314
#===========================================================================================
351315
Fixedpoints
352316
===========================================================================================#

0 commit comments

Comments
 (0)