-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nzy
committed
Feb 26, 2024
1 parent
86cd77a
commit 782788b
Showing
10 changed files
with
94 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
function correction_pauli_string(qubit_num::Int, syn::Dict{Int,Bool}, prob::Dict{Int,Vector{Float64}}) | ||
ps = ones(Int, qubit_num) | ||
for (k, v) in prob | ||
@show syn[k] | ||
if syn[k] #syn[k] is true, measure outcome is -1, use X or Y | ||
ps[k]=(findmax(v)[2]) == 1 ? 2 : 3 | ||
ps[k] = (findmax(v)[2]) == 1 ? 2 : 3 | ||
elseif findmax(v)[2] == 2 | ||
ps[k]=2 | ||
ps[k] = 4 | ||
end | ||
end | ||
return PauliString(ps...) | ||
return PauliString(ps[1:end]...) | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
using Test, TensorQEC, TensorQEC.Yao | ||
using Distributions | ||
|
||
function random_pauli_string(N::Int,p::Vector) | ||
values = [1, 2, 3, 4] # 1: I, 2: X, 3: Y, 4: Z | ||
return PauliString(([values[rand(Categorical(p[i]))] for i in 1:N]...,)) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters