diff --git a/src/QuantumClifford.jl b/src/QuantumClifford.jl index 71879ee0a..b29c06945 100644 --- a/src/QuantumClifford.jl +++ b/src/QuantumClifford.jl @@ -993,23 +993,17 @@ end # Conversion and promotion ############################## -Base.promote_rule(::Type{<:MixedStabilizer{T}} , ::Type{<:Stabilizer{T}} ) where {T<:Tableau} = Stabilizer{T} Base.promote_rule(::Type{<:MixedStabilizer{T}} , ::Type{<:MixedStabilizer{T}}) where {T<:Tableau} = Stabilizer{T} -Base.promote_rule(::Type{<:MixedStabilizer{T}} , ::Type{<:Destabilizer{T}} ) where {T<:Tableau} = MixedDestabilizer{T} Base.promote_rule(::Type{<:Stabilizer{T}} , ::Type{<:Destabilizer{T}} ) where {T<:Tableau} = MixedDestabilizer{T} Base.promote_rule(::Type{<:Destabilizer{T}} , ::Type{<:Destabilizer{T}} ) where {T<:Tableau} = MixedDestabilizer{T} Base.promote_rule(::Type{<:MixedDestabilizer{T}}, ::Type{<:Stabilizer{T}} ) where {T<:Tableau} = MixedDestabilizer{T} Base.promote_rule(::Type{<:MixedDestabilizer{T}}, ::Type{<:Destabilizer{T}} ) where {T<:Tableau} = MixedDestabilizer{T} -Base.promote_rule(::Type{<:MixedDestabilizer{T}}, ::Type{<:MixedStabilizer{T}}) where {T<:Tableau} = MixedDestabilizer{T} -Base.convert(::Type{<:Stabilizer{T}} , x::MixedStabilizer{T} ) where {T<:Tableau} = Stabilizer(tab(x)) Base.convert(::Type{<:MixedStabilizer{T}} , x::MixedStabilizer{T} ) where {T<:Tableau} = Stabilizer(tab(x)) Base.convert(::Type{<:Stabilizer{T}} , x::Destabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(x) Base.convert(::Type{<:Destabilizer{T}} , x::Destabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(x) Base.convert(::Type{<:MixedDestabilizer{T}} , x::Stabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(x) Base.convert(::Type{<:MixedDestabilizer{T}} , x::Destabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(x) -Base.convert(::Type{<:Destabilizer{T}} , x::MixedStabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(Stabilizer(tab(x))) -Base.convert(::Type{<:MixedDestabilizer{T}} , x::MixedStabilizer{T} ) where {T<:Tableau} = MixedDestabilizer(Stabilizer(tab(x))) ############################## # Helpers for binary codes diff --git a/src/linalg.jl b/src/linalg.jl index d9b1ec0f1..638c8583c 100644 --- a/src/linalg.jl +++ b/src/linalg.jl @@ -194,81 +194,6 @@ julia> tensor(d, md) + _X ``` -Tensor product between [`MixedStabilizer`](@ref) and [`Stabilizer`](@ref): - -```jldoctest promote -julia> ms = MixedStabilizer(S"-XZ//-ZX") -- XZ -- ZX - -julia> tensor(S"X", ms) -+ X__ -- _XZ -- _ZX -``` - -Tensor product between [`Stabilizer`](@ref) and [`Destabilizer`](@ref): - -```jldoctest promote -julia> tensor(S"X", d) -๐’Ÿโ„ฏ๐“ˆ๐“‰๐’ถ๐’ท -+ Z_ -- _Y -๐’ฎ๐“‰๐’ถ๐’ท -+ X_ -- _X -``` - -Tensor product between [`MixedStabilizer`](@ref) and [`MixedDestabilizer`](@ref): - -```jldoctest promote -julia> tensor(md, ms) -๐’Ÿโ„ฏ๐“ˆ๐“‰๐’ถ๐’ท -+ Z__ -+ _Z_ -+ __Z -๐’ฎ๐“‰๐’ถ๐’ทโ” -+ X__ -- _XZ -- _ZX -``` - -Tensor product between [`MixedStabilizer`](@ref) and [`Destabilizer`](@ref): - -```jldoctest promote -julia> tensor(d, ms) -๐’Ÿโ„ฏ๐“ˆ๐“‰๐’ถ๐’ท -- Y__ -+ _Z_ -+ __Z -๐’ฎ๐“‰๐’ถ๐’ทโ” -- X__ -- _XZ -- _ZX -``` - -Tensor product between [`Destabilizer`](@ref) and [`Destabilizer`](@ref): - -```jldoctest promote -julia> tensor(d, d) -๐’Ÿโ„ฏ๐“ˆ๐“‰๐’ถ๐’ท -- Y_ -- _Y -๐’ฎ๐“‰๐’ถ๐’ท -- X_ -- _X -``` - -Tensor product between [`MixedStabilizer`](@ref) and [`MixedStabilizer`](@ref): - -```jldoctest promote -julia> tensor(ms, ms) -- XZ__ -- ZX__ -- __XZ -- __ZX -``` - See also [`tensor_pow`](@ref).""" function tensor end diff --git a/test/test_stabs.jl b/test/test_stabs.jl index 0aca351bc..e5730ca66 100644 --- a/test/test_stabs.jl +++ b/test/test_stabs.jl @@ -64,19 +64,10 @@ d = random_destabilizer(n) dmd = dโŠ—md @test mixed_destab_looks_good(dmd) - ms = MixedStabilizer(random_stabilizer(n)) - mss = sโŠ—ms - @test mixed_stab_looks_good(mss) sd = random_stabilizer(n)โŠ—random_destabilizer(n) @test mixed_destab_looks_good(sd) - mdms = mdโŠ—ms - @test mixed_destab_looks_good(mdms) - dms = dโŠ—ms - @test mixed_destab_looks_good(dms) dd = dโŠ—d @test destab_looks_good(dd) - msms = msโŠ—ms - @test mixed_stab_looks_good(msms) end end