1- function Base. summary (io:: IO , ψ:: FiniteMPS )
2- L = length (ψ)
3- D = maximum (dim, left_virtualspace (ψ))
4- return print (io, " $L -site FiniteMPS ($(scalartype (ψ)) , $(TensorKit. type_repr (spacetype (ψ))) ) maxdim = " , D, " \t center = " , ψ. center)
5- end
6-
7- for T in (:InfiniteMPS , :FiniteMPO , :InfiniteMPO , :FiniteMPOHamiltonian , :InfiniteMPOHamiltonian )
8- @eval function Base. summary (io:: IO , mpo:: $T )
9- L = length (mpo)
10- D = maximum (dim, left_virtualspace (mpo))
11- T = scalartype (mpo)
12- S = TensorKit. type_repr (spacetype (mpo))
13- print (io, L, " -site " , $ (string (T)), " (" , scalartype (mpo), " , " , S, " ) maxdim = " , D)
1+ for T in (:FiniteMPS , :InfiniteMPS , :FiniteMPO , :InfiniteMPO , :FiniteMPOHamiltonian , :InfiniteMPOHamiltonian )
2+ @eval function Base. summary (io:: IO , x:: $T )
3+ L = length (x)
4+ D = maximum (dim, left_virtualspace (x))
5+ E = scalartype (x)
6+ S = TensorKit. type_repr (spacetype (x))
7+ print (io, L, " -site " , $ (string (T)), " (" , E, " , " , S, " ) with maximal dimension " , D)
8+ $ (T === :FiniteMPS ) && print (io, " and center " , x. center)
149 return nothing
1510 end
1611end
@@ -169,19 +164,6 @@ function Base.show(io::IO, ::MIME"text/plain", mpo::AbstractMPO)
169164 return nothing
170165end
171166
172- function Base. showarg (io:: IO , envs:: FiniteEnvironments , toplevel:: Bool )
173- print (io, " environments(state, " )
174- Base. showarg (io, envs. operator, false )
175- if isnothing (envs. above)
176- print (io, " )" )
177- else
178- print (io, " , " )
179- Base. showarg (io, envs. above, false )
180- print (io, " )" )
181- end
182- return nothing
183- end
184-
185167function Base. summary (io:: IO , envs:: Union{FiniteEnvironments, InfiniteEnvironments} )
186168 print (io, length (envs. GLs), " -site " )
187169 Base. showarg (io, envs, true )
@@ -193,11 +175,11 @@ function Base.show(io::IO, ::MIME"text/plain", envs::Union{InfiniteEnvironments,
193175 get (io, :compact , false ):: Bool && return nothing
194176 println (io, " :" )
195177
196- for (i, gl) in enumerate ( envs. GLs)
197- println (io, " GL[$i ]: " , space (gl ))
178+ for i in reverse ( eachindex ( envs. GLs) )
179+ println (io, " GL[$i ]: " , space (envs . GLs[i] ))
198180 end
199- for (i, gr) in enumerate ( envs. GRs)
200- println (io, " GR[$i ]: " , space (gr ))
181+ for i in reverse ( eachindex ( envs. GRs) )
182+ println (io, " GR[$i ]: " , space (envs . GRs[i] ))
201183 end
202184
203185 return nothing
0 commit comments