Skip to content

Commit

Permalink
remove redundant comments and add back an incorrectly removed TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov committed Sep 27, 2024
1 parent 11376fd commit 99ab972
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
3 changes: 0 additions & 3 deletions src/QuantumClifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,8 @@ end
# Conversion and promotion
##############################

# Destabilizer, MixedDestabilizer -> MixedDestabilizer
Base.promote_rule(::Type{<:Destabilizer{T}} , ::Type{<:MixedDestabilizer{T}}) where {T<:Tableau} = MixedDestabilizer{T}
# MixedStabilizer, MixedDestabilizer -> MixedDestabilizer
Base.promote_rule(::Type{<:MixedStabilizer{T}}, ::Type{<:MixedDestabilizer{T}}) where {T<:Tableau} = MixedDestabilizer{T}
# Stabilizer, T<:Union{MixedStabilizer, Destabilizer, MixedDestabilizer} -> T
Base.promote_rule(::Type{<:Stabilizer{T}} , ::Type{<:S} ) where {T<:Tableau, S<:Union{MixedStabilizer{T}, Destabilizer{T}, MixedDestabilizer{T}}} = S

Base.convert(::Type{<:MixedDestabilizer{T}}, x::Union{Destabilizer{T}, MixedStabilizer{T}, Stabilizer{T}}) where {T <: Tableau} = MixedDestabilizer(x)
Expand Down
20 changes: 1 addition & 19 deletions src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,28 +158,10 @@ julia> tensor(s, s)
- ____Z_
```
Tensor product between [`MixedDestabilizer`](@ref) and [`Stabilizer`](@ref):
```jldoctest promote
julia> md = MixedDestabilizer(T"Z//X", 1)
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z
𝒮𝓉𝒶𝒷
+ X
julia> tensor(S"X", md)
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z_
+ _Z
𝒮𝓉𝒶𝒷
+ X_
+ _X
```
See also [`tensor_pow`](@ref)."""
function tensor end

function tensor(ops::AbstractStabilizer...)
function tensor(ops::AbstractStabilizer...) # TODO optimize by pre-allocating one large tableau instead of the current quadratic fold
ct = promote_type(map(typeof, ops)...)
conv_ops = map(x -> convert(ct, x), ops)
return foldl(, conv_ops)
Expand Down

0 comments on commit 99ab972

Please sign in to comment.