Skip to content

Commit

Permalink
proper normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Nov 16, 2024
1 parent 854e5c5 commit 84383f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nonclifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ function _proj(sm::GeneralizedStabilizer, p::PauliOperator)
# where (S′, D′) is derived from (S, D) through the traditional stabilizer update,
# and χ′ is the updated density matrix after measurement. Note: Λ(χ′) ≤ Λ(χ).
n = nqubits(sm)
# The trace Tr[sm′] = Tr[χᵢⱼ′] serves as the normalization required for sm′.
χ′′ = expect(p, sm)/LinearAlgebra.tr(expect(p, sm))
state, res = projectrand!(sm.stab, p)
sm = GeneralizedStabilizer(state, DefaultDict(0.0im, (falses(n),falses(n))=>expect(p, sm)))
sm = GeneralizedStabilizer(state, DefaultDict(0.0im, (falses(n),falses(n))=>χ′′))
return sm, res
end

Expand Down

0 comments on commit 84383f2

Please sign in to comment.