From e5c5dc36c6e67e7b09ac9514b47ce0548a5ffe92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jofre=20Vall=C3=A8s=20Muns?= <61060572+jofrevalles@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:55:55 +0200 Subject: [PATCH] Update src/Array.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sergio Sánchez Ramírez <15837247+mofeing@users.noreply.github.com> --- src/Array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Array.jl b/src/Array.jl index 4f7985d..53239dd 100644 --- a/src/Array.jl +++ b/src/Array.jl @@ -194,7 +194,7 @@ 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} = (M == 2*N) ? Array{T,2N}(reshape(Matrix{T}(op), fill(2, 2N)...)) : throw(ArgumentError("Invalid dimensions")) +Array{T,M}(op::SU{N}) where {T,N,M} = (M == 2*N) ? Array{T,2N}(reshape(Matrix{T}(op), fill(2, 2N)...)) : throw(DimensionMismatch("Array representation of SU{$N} has $(2N) dimensions, but $M was solicited")) # diagonal matrices # NOTE efficient multiplication due to no memory swap needed: plain element-wise multiplication