-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test suite for [[4p, 2(p − 2), 4]] DelfosseRepCode
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@testitem "ECC [[4p, 2(p − 2), 4]] DelfosseRepCode" begin | ||
|
||
using LinearAlgebra | ||
using QuantumClifford.ECC | ||
using QuantumClifford.ECC: DelfosseRepCode, _extend_414_repetition_code | ||
using Nemo: matrix, GF | ||
|
||
@testset "Testing [[4p, 2(p − 2), 4]] DelfosseRepCode properties" begin | ||
for i in 1:50 | ||
p = 2*i | ||
n = 4*p | ||
k = 2*(p - 2) | ||
stab = parity_checks(DelfosseRepCode(p)) | ||
H = stab_to_gf2(stab) | ||
mat = matrix(GF(2), H) | ||
computed_rank = rank(mat) | ||
@test computed_rank == n - k | ||
end | ||
|
||
# crosscheck parity check matrices from VIII. 1 Generalizing the [4, 1, 4] | ||
# classical repetition code, pg. 10 of https://arxiv.org/pdf/2008.05051 | ||
blocks = 1 | ||
@test _extend_414_repetition_code(blocks) == [1 1 1 1; | ||
0 0 1 1; | ||
0 1 0 1]; | ||
blocks = 4 | ||
# [16, 10, 4] classical linear code | ||
@test _extend_414_repetition_code(blocks) == [1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0; | ||
0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0; | ||
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0; | ||
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1; | ||
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1; | ||
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1] | ||
blocks = 6 | ||
# [24, 16, 4] classical linear code | ||
@test _extend_414_repetition_code(blocks) == [1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; | ||
0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; | ||
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0; | ||
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0; | ||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0; | ||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1; | ||
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1; | ||
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1]; | ||
end | ||
end |