Skip to content

Commit

Permalink
Remove new function and fix arraytype(SU{N}) instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed Apr 12, 2024
1 parent 5533b33 commit 58ae0c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ arraytype(::Swap) = Array{Bool,4}
arraytype(::ISwap) = Array{Complex{Bool},4}
arraytype(::FSwap) = Array{Int,4}

arraytype(::SU{N}) where {N} = Array{ComplexF64,2N}
arraytype(::SU{N}) where {N} = Array{ComplexF64}

arraytype(op::Control) = Array{ComplexF64,2 * length(op)}

Expand Down Expand Up @@ -194,7 +194,6 @@ Array{T}(op::Op) where {T,Op<:Control} = Array{T,2 * length(Op)}(op)
Array{T,N}(op::Control) where {T,N} = Array{T,N}(reshape(Matrix{T}(op), fill(2, N)...))

Array{T}(op::SU{N}) where {T,N} = Array{T,2N}(reshape(Matrix{T}(op), fill(2, 2N)...))
Array{T, M}(op::SU{N}) where {T, N, M} = (@assert M == 2 * N "M must be exactly 2 * N"; Array{T, 2N}(reshape(Matrix{T}(op), fill(2, 2N)...)))

# diagonal matrices
# NOTE efficient multiplication due to no memory swap needed: plain element-wise multiplication
Expand Down

0 comments on commit 58ae0c1

Please sign in to comment.