-
Notifications
You must be signed in to change notification settings - Fork 49
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
Showing
6 changed files
with
41 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,5 +434,4 @@ @article{anderson2014fault | |
pages={080501}, | ||
year={2014}, | ||
publisher={APS} | ||
} | ||
} |
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
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,33 +1,38 @@ | ||
using Test | ||
using Nemo: echelon_form, matrix, GF | ||
using LinearAlgebra | ||
using QuantumClifford | ||
using QuantumClifford: canonicalize!, Stabilizer, stab_to_gf2 | ||
using QuantumClifford.ECC | ||
using QuantumClifford.ECC: AbstractECC, QuantumReedMuller, Steane7 | ||
@testitem "Quantum Reed-Muller" begin | ||
using Test | ||
using Nemo: echelon_form, matrix, GF | ||
using LinearAlgebra | ||
using QuantumClifford | ||
using QuantumClifford: canonicalize!, Stabilizer, stab_to_gf2 | ||
using QuantumClifford.ECC | ||
using QuantumClifford.ECC: AbstractECC, QuantumReedMuller, Steane7 | ||
|
||
function designed_distance(matrix) | ||
distance = 3 | ||
for row in eachrow(matrix) | ||
count = sum(row) | ||
if count < distance | ||
return false | ||
function designed_distance(mat) | ||
dist = 3 | ||
for row in eachrow(mat) | ||
count = sum(row) | ||
if count < dist | ||
return false | ||
end | ||
end | ||
return true | ||
end | ||
return true | ||
end | ||
|
||
@testset "Test QRM(r, m) properties" begin | ||
for m in 3:10 | ||
stab = parity_checks(QuantumReedMuller(m)) | ||
H = stab_to_gf2(stab) | ||
@test designed_distance(H) == true | ||
# QuantumReedMuller(3) is the Steane7() code. | ||
@test canonicalize!(parity_checks(Steane7())) == parity_checks(QuantumReedMuller(3)) | ||
@test code_n(QuantumReedMuller(m)) == 2 ^ m - 1 | ||
@test code_k(QuantumReedMuller(m)) == 1 | ||
@test distance(QuantumReedMuller(m)) == 3 | ||
@test parity_checks_x(QuantumReedMuller(m)) == H[1:m, 1: 1:end÷2] | ||
@test parity_checks_z(QuantumReedMuller(m)) == H[end-(code_n(QuantumReedMuller(m)) - 2 - m):end, end÷2+1:end] | ||
@testset "Test QuantumReedMuller(r,m) properties" begin | ||
for m in 3:10 | ||
stab = parity_checks(QuantumReedMuller(m)) | ||
H = stab_to_gf2(stab) | ||
@test designed_distance(H) == true | ||
# QuantumReedMuller(3) is the Steane7 code. | ||
@test canonicalize!(parity_checks(Steane7())) == parity_checks(QuantumReedMuller(3)) | ||
@test code_n(QuantumReedMuller(m)) == 2^m - 1 | ||
@test code_k(QuantumReedMuller(m)) == 1 | ||
@test distance(QuantumReedMuller(m)) == 3 | ||
@test parity_checks_x(QuantumReedMuller(m)) == H[1:m, 1: 1:end÷2] | ||
@test parity_checks_z(QuantumReedMuller(m)) == H[end-(code_n(QuantumReedMuller(m))-2-m):end, end÷2+1:end] | ||
# [[15,1,3]] qrm code from table 1 of https://arxiv.org/pdf/1705.0010 | ||
qrm₁₅₁₃ = S"ZIZIZIZIZIZIZIZ//IZZIIZZIIZZIIZZ//IIIZZZZIIIIZZZZ//IIIIIIIZZZZZZZZ//IIZIIIZIIIZIIIZ//IIIIZIZIIIIIZIZ//IIIIIZZIIIIIIZZ//IIIIIIIIIZZIIZZ//IIIIIIIIIIIZZZZ//IIIIIIIIZIZIZIZ//XIXIXIXIXIXIXIX//IXXIIXXIIXXIIXX//IIIXXXXIIIIXXXX//IIIIIIIXXXXXXXX" | ||
@test canonicalize!(parity_checks(qrm₁₅₁₃)) == canonicalize!(parity_checks(QuantumReedMuller(4))) | ||
end | ||
end | ||
end |