Skip to content

Commit f70b320

Browse files
committed
improving documentation for apply
1 parent 44bb785 commit f70b320

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/nonclifford.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,31 @@ function _stabmixdestab(mixeddestab, d)
8989
p
9090
end
9191

92+
"""
93+
Updates the generalized stabilizer `τ = (χ, B(S, D))` by applying a Clifford gate `G`,
94+
where `χ` represents the density matrix and `B(S, D)` denotes the stabilizer basis in
95+
which `χ` is expressed.
96+
97+
```jldoctest
98+
julia> sm = GeneralizedStabilizer(S"-X")
99+
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
100+
𝒟ℯ𝓈𝓉𝒶𝒷
101+
+ Z
102+
𝒮𝓉𝒶𝒷
103+
- X
104+
with ϕᵢⱼ | Pᵢ | Pⱼ:
105+
1.0+0.0im | + _ | + _
106+
107+
julia> apply!(sm, CliffordOperator(sHadamard))
108+
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
109+
𝒟ℯ𝓈𝓉𝒶𝒷
110+
+ X
111+
𝒮𝓉𝒶𝒷
112+
- Z
113+
with ϕᵢⱼ | Pᵢ | Pⱼ:
114+
1.0+0.0im | + _ | + _
115+
```
116+
"""
92117
function apply!(state::GeneralizedStabilizer, gate::AbstractCliffordOperator) # TODO conjugate also the destabs
93118
apply!(state.stab, gate)
94119
state

0 commit comments

Comments
 (0)