Skip to content

Commit ab2c1a4

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

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/nonclifford.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ 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> apply!(sm, CliffordOperator(sHadamard))
99+
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
100+
𝒟ℯ𝓈𝓉𝒶𝒷
101+
+ X
102+
𝒮𝓉𝒶𝒷
103+
- Z
104+
with ϕᵢⱼ | Pᵢ | Pⱼ:
105+
1.0+0.0im | + _ | + _
106+
```
107+
"""
92108
function apply!(state::GeneralizedStabilizer, gate::AbstractCliffordOperator) # TODO conjugate also the destabs
93109
apply!(state.stab, gate)
94110
state

0 commit comments

Comments
 (0)