From d7be66b0c5fd1baeb92059c140fa993cd35156f0 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Sun, 22 Sep 2024 09:48:48 +0500 Subject: [PATCH] fix #191: too restrictive typeassert for MixedDestabilizer --- src/QuantumClifford.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/QuantumClifford.jl b/src/QuantumClifford.jl index 407af5959..29114bdbc 100644 --- a/src/QuantumClifford.jl +++ b/src/QuantumClifford.jl @@ -569,8 +569,13 @@ function MixedDestabilizer(stab::Stabilizer{T}; undoperm=true, reportperm=false) t[n+r+s+1:end] = sZ # The other logical set in the tableau end if undoperm - t = t[:,invperm(permx[permz])]::T - return MixedDestabilizer(t, r+s)::MixedDestabilizer{T} + if isa(t, SubArray) + t = t[:, invperm(permx[permz])]::T + return MixedDestabilizer(t, r+s)::MixedDestabilizer{T} + else + t = t[:, invperm(permx[permz])] + return MixedDestabilizer(t, r+s) + end end if reportperm return (MixedDestabilizer(t, r+s)::MixedDestabilizer{T}, r, permx, permz)