Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/MPSKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export QP, LeftGaugedQP, RightGaugedQP
# operators:
export AbstractMPO
export MPO, FiniteMPO, InfiniteMPO
export JordanMPOTensor, JordanMPOTensorMap
export MPOHamiltonian, FiniteMPOHamiltonian, InfiniteMPOHamiltonian
export MultilineMPO
export UntimedOperator, TimedOperator, MultipliedOperator, LazySum
Expand Down Expand Up @@ -123,7 +124,6 @@ include("operators/projection.jl")
include("operators/timedependence.jl")
include("operators/multipliedoperator.jl")
include("operators/lazysum.jl")
include("operators/show.jl")

include("transfermatrix/transfermatrix.jl")
include("transfermatrix/transfer.jl")
Expand Down Expand Up @@ -189,6 +189,8 @@ include("algorithms/ED.jl")

include("algorithms/unionalg.jl")

include("utility/show.jl")

function __init__()
Defaults.set_scheduler!()
return nothing
Expand Down
2 changes: 1 addition & 1 deletion src/environments/finite_envs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
struct FiniteEnvironments <: AbstractMPSEnvironments

Environment manager for `FiniteMPS` and `WindowMPS`. This structure is responsable for automatically checking
Environment manager for `FiniteMPS` and `WindowMPS`. This structure is responsible for automatically checking
if the queried environment is still correctly cached and if not recalculates.
"""
struct FiniteEnvironments{A, B, C, D} <: AbstractMPSEnvironments
Expand Down
27 changes: 16 additions & 11 deletions src/operators/jordanmpotensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ struct JordanMPOTensor{
end
end

const JordanMPOTensorMap{T, S, A <: DenseVector{T}} = JordanMPOTensor{
T, S,
Union{TensorMap{T, S, 2, 2, A}, BraidingTensor{T, S}},
TensorMap{T, S, 2, 1, A},
TensorMap{T, S, 1, 2, A},
TensorMap{T, S, 1, 1, A},
}

function JordanMPOTensor{E, S}(::UndefInitializer, V::TensorMapSumSpace{S}) where {E, S}
return jordanmpotensortype(S, E)(undef, V)
end
Expand Down Expand Up @@ -378,15 +386,12 @@ function Base.isapprox(W1::JordanMPOTensor, W2::JordanMPOTensor; kwargs...)
isapprox(W1.D, W2.D; kwargs...)
end

function Base.summary(io::IO, W::JordanMPOTensor)
szstring = Base.dims2string(size(W))
TT = eltype(W)
typeinfo = get(io, :typeinfo, Any)
if typeinfo <: typeof(W) || typeinfo <: TT
typestring = ""
else
typestring = "{$TT}"
end
V = space(W)
return print(io, "$szstring JordanMPOTensor$typestring($V)")
function Base.showarg(io::IO, W::JordanMPOTensor, toplevel::Bool)
!toplevel && print(io, "::")
print(io, TensorKit.type_repr(typeof(W)))
return nothing
end

function TensorKit.type_repr(::Type{<:JordanMPOTensor{E, S}}) where {E, S}
return "JordanMPOTensor{$E, " * TensorKit.type_repr(S) * ", …}"
end
97 changes: 0 additions & 97 deletions src/operators/show.jl

This file was deleted.

65 changes: 0 additions & 65 deletions src/states/finitemps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -439,71 +439,6 @@ Compute the dimension of the maximal virtual space at a given site.
"""
max_Ds(ψ::FiniteMPS) = dim.(max_virtualspaces(ψ))

function Base.summary(io::IO, ψ::FiniteMPS)
return print(io, "$(length(ψ))-site FiniteMPS ($(scalartype(ψ)), $(spacetype(ψ)))")
end
function Base.show(io::IO, ::MIME"text/plain", ψ::FiniteMPS)
println(io, summary(ψ), ":")
context = IOContext(io, :typeinfo => eltype(ψ), :compact => true)
return show(context, ψ)
end
Base.show(io::IO, ψ::FiniteMPS) = show(convert(IOContext, io), ψ)
function Base.show(io::IOContext, ψ::FiniteMPS)
charset = (; start = "┌", mid = "├", stop = "└", ver = "│", dash = "──")
limit = get(io, :limit, false)::Bool
half_screen_rows = limit ? div(displaysize(io)[1] - 8, 2) : typemax(Int)
if !haskey(io, :compact)
io = IOContext(io, :compact => true)
end

L = length(ψ)
c = ψ.center

for site in HalfInt.(reverse((1 / 2):(1 / 2):(L + 1 / 2)))
if site < half_screen_rows || site > L - half_screen_rows
if site > c # ARs
if isinteger(site)
println(
io, Int(site) == L ? charset.start : charset.mid, charset.dash,
" AR[$(Int(site))]: ", ψ.ARs[Int(site)]
)
end
elseif site == c # AC or C
if isinteger(c) # center is an AC
println(
io, if site == L
charset.start
elseif site == 1
charset.stop
else
charset.mid
end, charset.dash, " AC[$(Int(site))]: ", ψ.ACs[Int(site)]
)
else # center is a bond-tensor
println(
io, if site == HalfInt(L + 1 / 2)
charset.start
elseif site == HalfInt(1 / 2)
charset.stop
else
charset.ver
end, " C[$(Int(site - 1 / 2))]: ", ψ.Cs[Int(site + 1 / 2)]
)
end
else
if isinteger(site)
println(
io, site == 1 ? charset.stop : charset.mid, charset.dash,
" AL[$(Int(site))]: ", ψ.ALs[Int(site)]
)
end
end
elseif site == half_screen_rows
println(io, charset.ver, "⋮")
end
end
return nothing
end

#===========================================================================================
Linear Algebra
Expand Down
30 changes: 0 additions & 30 deletions src/states/infinitemps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,36 +311,6 @@ function Base.isapprox(ψ₁::InfiniteMPS, ψ₂::InfiniteMPS; kwargs...)
return isapprox(dot(ψ₁, ψ₂), 1; kwargs...)
end

function Base.show(io::IO, ::MIME"text/plain", ψ::InfiniteMPS)
L = length(ψ)
println(io, L == 1 ? "single site" : "$L-site", " InfiniteMPS:")
context = IOContext(io, :typeinfo => eltype(ψ), :compact => true)
return show(context, ψ)
end
Base.show(io::IO, ψ::InfiniteMPS) = show(convert(IOContext, io), ψ)
function Base.show(io::IOContext, ψ::InfiniteMPS)
charset = (; mid = "├", ver = "│", dash = "──")
limit = get(io, :limit, false)::Bool
half_screen_rows = limit ? div(displaysize(io)[1] - 8, 2) : typemax(Int)
if !haskey(io, :compact)
io = IOContext(io, :compact => true)
end
L = length(ψ)
println(io, charset.ver, " ⋮")
for site in reverse(1:L)
if site < half_screen_rows || site > L - half_screen_rows
if site == L
println(io, charset.ver, " C[$site]: ", ψ.C[site])
end
println(io, charset.mid, charset.dash, " AL[$site]: ", ψ.AL[site])
elseif site == half_screen_rows
println(io, charset.ver, "⋮")
end
end
println(io, charset.ver, " ⋮")
return nothing
end

#===========================================================================================
Fixedpoints
===========================================================================================#
Expand Down
Loading