From df5092cc2534839685cb6975d7359507d5b76346 Mon Sep 17 00:00:00 2001 From: amitjamadagni Date: Sun, 12 Jul 2015 18:55:40 +0800 Subject: [PATCH] Complex coeffs support. --- src/arrays/arraymath.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/arrays/arraymath.jl b/src/arrays/arraymath.jl index ffec121..190485c 100644 --- a/src/arrays/arraymath.jl +++ b/src/arrays/arraymath.jl @@ -121,6 +121,9 @@ function \{B<:OrthonormalBasis}(op::AbstractQuMatrix{B}, vec::AbstractQuVector{B return QAT(div, bases(op,1)) end +# convert coeffs to complex +Base.complex{B<:OrthonormalBasis}(qarr::AbstractQuArray{B}) = similar_type(qarr)(complex(coeffs(vec(qarr))), bases(qarr)) + # Vectorize QuArray Base.vec{B<:OrthonormalBasis}(vec1::AbstractQuArray{B}) = QuArray(vec(coeffs(vec1)))