Skip to content

Commit 23bdc70

Browse files
committed
Add complex(::InfiniteMPS)
1 parent cbdd30c commit 23bdc70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/states/infinitemps.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ function Base.copy!(ψ::InfiniteMPS, ϕ::InfiniteMPS)
224224
return ψ
225225
end
226226

227+
function Base.complex::InfiniteMPS)
228+
scalartype(ψ) <: Complex && return ψ
229+
return InfiniteMPS(complex.(ψ.AL), complex.(ψ.AR), complex.(ψ.C), complex.(ψ.AC))
230+
end
231+
227232
function Base.repeat::InfiniteMPS, i::Int)
228233
return InfiniteMPS(repeat.AL, i), repeat.AR, i), repeat.C, i), repeat.AC, i))
229234
end

0 commit comments

Comments
 (0)