@@ -116,35 +116,42 @@ function InfiniteMPS(
116116 convert (PeriodicVector{B}, C), convert (PeriodicVector{A}, AC)
117117 )
118118end
119-
119+ function InfiniteMPS (
120+ T:: Type ,
121+ pspaces:: AbstractVector{S} , Dspaces:: AbstractVector{S} ;
122+ kwargs...
123+ ) where {S <: IndexSpace }
124+ return InfiniteMPS (MPSTensor .(rand, T, pspaces, circshift (Dspaces, 1 ), Dspaces); kwargs... )
125+ end
120126function InfiniteMPS (
121127 pspaces:: AbstractVector{S} , Dspaces:: AbstractVector{S} ;
122128 kwargs...
123129 ) where {S <: IndexSpace }
124- return InfiniteMPS (MPSTensor .(pspaces, circshift (Dspaces, 1 ), Dspaces); kwargs... )
130+ return InfiniteMPS (MPSTensor .(rand, ComplexF64, pspaces, circshift (Dspaces, 1 ), Dspaces); kwargs... )
125131end
126132function InfiniteMPS (
127- f, elt :: Type{<:Number} , pspaces:: AbstractVector{S} , Dspaces:: AbstractVector{S} ;
133+ f, T :: Type , pspaces:: AbstractVector{S} , Dspaces:: AbstractVector{S} ;
128134 kwargs...
129135 ) where {S <: IndexSpace }
130136 return InfiniteMPS (
131- MPSTensor .(f, elt , pspaces, circshift (Dspaces, 1 ), Dspaces);
137+ MPSTensor .(f, T , pspaces, circshift (Dspaces, 1 ), Dspaces);
132138 kwargs...
133139 )
134140end
135- InfiniteMPS (d:: S , D:: S ) where {S <: Union{Int, <:IndexSpace} } = InfiniteMPS ([d], [D])
141+ InfiniteMPS (T:: Type , d:: S , D:: S ; kwargs... ) where {S <: Union{Int, <:IndexSpace} } = InfiniteMPS (T, [d], [D]; kwargs... )
142+ InfiniteMPS (d:: S , D:: S ; kwargs... ) where {S <: Union{Int, <:IndexSpace} } = InfiniteMPS ([d], [D]; kwargs... )
136143function InfiniteMPS (
137- f, elt :: Type{<:Number} , d:: S , D:: S
144+ f, T :: Type , d:: S , D:: S ; kwargs ...
138145 ) where {S <: Union{Int, <:IndexSpace} }
139- return InfiniteMPS (f, elt , [d], [D])
146+ return InfiniteMPS (f, T , [d], [D]; kwargs ... )
140147end
141- function InfiniteMPS (ds:: AbstractVector{Int} , Ds:: AbstractVector{Int} )
142- return InfiniteMPS (ComplexSpace .(ds), ComplexSpace .(Ds))
148+ function InfiniteMPS (ds:: AbstractVector{Int} , Ds:: AbstractVector{Int} ; kwargs ... )
149+ return InfiniteMPS (ComplexSpace .(ds), ComplexSpace .(Ds); kwargs ... )
143150end
144151function InfiniteMPS (
145- f, elt :: Type{<:Number} , ds:: AbstractVector{Int} , Ds:: AbstractVector{Int} , kwargs...
152+ f, T :: Type , ds:: AbstractVector{Int} , Ds:: AbstractVector{Int} , kwargs...
146153 )
147- return InfiniteMPS (f, elt , ComplexSpace .(ds), ComplexSpace .(Ds); kwargs... )
154+ return InfiniteMPS (f, T , ComplexSpace .(ds), ComplexSpace .(Ds); kwargs... )
148155end
149156
150157function InfiniteMPS (A:: AbstractVector{<:GenericMPSTensor} ; kwargs... )
0 commit comments