Skip to content

Commit

Permalink
improving documentation for apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Aug 23, 2024
1 parent 44bb785 commit f70b320
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/nonclifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ function _stabmixdestab(mixeddestab, d)
p
end

"""
Updates the generalized stabilizer `τ = (χ, B(S, D))` by applying a Clifford gate `G`,
where `χ` represents the density matrix and `B(S, D)` denotes the stabilizer basis in
which `χ` is expressed.
```jldoctest
julia> sm = GeneralizedStabilizer(S"-X")
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z
𝒮𝓉𝒶𝒷
- X
with ϕᵢⱼ | Pᵢ | Pⱼ:
1.0+0.0im | + _ | + _
julia> apply!(sm, CliffordOperator(sHadamard))
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ X
𝒮𝓉𝒶𝒷
- Z
with ϕᵢⱼ | Pᵢ | Pⱼ:
1.0+0.0im | + _ | + _
```
"""
function apply!(state::GeneralizedStabilizer, gate::AbstractCliffordOperator) # TODO conjugate also the destabs
apply!(state.stab, gate)
state
Expand Down

0 comments on commit f70b320

Please sign in to comment.