@@ -7,35 +7,6 @@ Abstract supertype for Matrix Product Operators (MPOs).
77"""
88abstract type AbstractMPO{O<: MPOTensor } <: AbstractVector{O} end
99
10- # Hamiltonian Matrix Product Operators
11- # ====================================
12- """
13- abstract type AbstractHMPO{O<:MPOTensor} <: AbstractMPO{O}
14-
15- Abstract supertype for Hamiltonian MPOs.
16- """
17- abstract type AbstractHMPO{O<: MPOTensor } <: AbstractMPO{O} end
18-
19- function HMPO (lattice:: AbstractVector{S} , terms... ) where {S<: VectorSpace }
20- if lattice isa PeriodicArray
21- return InfiniteMPOHamiltonian (lattice, terms... )
22- else
23- return FiniteMPOHamiltonian (lattice, terms... )
24- end
25- end
26- function HMPO (operator:: AbstractTensorMap{E,S,N,N} ; L= Inf ) where {E,S,N}
27- @assert domain (operator) == codomain (operator) " Not a valid Hamiltonian operator."
28- @assert allequal (collect (domain (operator))) " The operator must have the same local spaces."
29-
30- if isfinite (L)
31- lattice = repeat ([space (operator, 1 )], L)
32- return HMPO (lattice, ntuple (x -> x + i - 1 , N) => operator for i in 1 : (L - (N - 1 )))
33- else
34- lattice = PeriodicArray ([space (operator, 1 )])
35- return HMPO (lattice, ntuple (identity, N) => operator)
36- end
37- end
38-
3910# useful union types
4011const SparseMPO{O<: SparseBlockTensorMap } = AbstractMPO{O}
4112
0 commit comments