From 67165b939a3cb0660806e8fdfe335022691d6a97 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Thu, 18 Jul 2024 14:16:00 +0500 Subject: [PATCH] minor cleanup in TODO3(apply) --- src/nonclifford.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nonclifford.jl b/src/nonclifford.jl index 1df67b58b..7531ae684 100644 --- a/src/nonclifford.jl +++ b/src/nonclifford.jl @@ -209,7 +209,9 @@ function apply!(state::GeneralizedStabilizer, gate::AbstractPauliChannel; prune_ dᵢ′ = dₗ .⊻ dᵢ dⱼ′ = dᵣ .⊻ dⱼ χ′ = χ * w * (-tone)^c * (im)^(-phaseₗ+phaseᵣ+4) - newdict[(dᵢ′,dⱼ′)] = get!(newdict,(dᵢ′,dⱼ′),0)+χ′ + if abs(χ′) >= prune_threshold + newdict[(dᵢ′,dⱼ′)] = get!(newdict,(dᵢ′,dⱼ′),0)+χ′ + end end end filter!(x -> abs(x[2]) >= prune_threshold, newdict)