Open Fe-r-oz opened 1 month ago
Attention: Patch coverage is 88.09524%
with 5 lines
in your changes missing coverage. Please review.
Project coverage is 82.95%. Comparing base (
dddaedb
) to head (5cd26c6
).
Files | Patch % | Lines |
---|---|---|
src/ecc/codes/classical/golay.jl | 88.09% | 5 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Kindly please review these short PRs @Krastanov 🙏🏼. The sequence of review of PRs can be 277, 276, 254. Thank you 🙏🏼
Should I add [[23, 1, 7]] quantum Golay code here as well? It will take max 20 lines. This code is self-dual, perfect CSS code.
Applications of this code: 1) Magic State Distillation 2) Implement all the Clifford Gates transversally
""" The paper describes that the code is self-dual, and the X and Z stabilizer generators can both be given by the following eleven 23-character strings:
. 1 . . 1 . . 1 1 1 1 1 . . . . . . . . . . 1
1 . . 1 . . 1 1 1 1 1 . . . . . . . . . . 1 .
. 1 1 . 1 1 1 . . . 1 1 . . . . . . . . 1 . .
1 1 . 1 1 1 . . . 1 1 . . . . . . . . 1 . . .
1 1 1 1 . . . 1 . . 1 1 . . . . . . 1 . . . .
1 . 1 . 1 . 1 1 1 . . 1 . . . . . 1 . . . . .
. . . 1 1 1 1 . 1 1 . 1 . . . . 1 . . . . . .
. . 1 1 1 1 . 1 1 . 1 . . . . 1 . . . . . . .
. 1 1 1 1 . 1 1 . 1 . . . . 1 . . . . . . . .
1 1 1 1 . 1 1 . 1 . . . . 1 . . . . . . . . .
1 . 1 . . 1 . . 1 1 1 1 1 . . . . . . . . . .
Here, the 1s in a row either all indicate Z operators or all indicate X operators, and dots indicate I operators. """
We can go with the first one as it take 65 gates which is least expensive. The paper implements them with 57 CNOTs.
parity_checks(c::QuantumGolay) = S"X_X__X__XXXXX__________
XXXX_XX_X____X_________
_XXXX_XX_X____X________
__XXXX_XX_X____X_______
___XXXX_XX_X____X______
Z_Z_Z_ZZZ__Z_____Z_____
ZZZZ___Z__ZZ______Z____
ZZ_ZZZ___ZZ________Z___
_ZZ_ZZZ___ZZ________Z__
Z__Z__ZZZZZ__________Z_
_Z__Z__ZZZZZ__________Z"
julia> naive_encoding_circuit(s8)
65-element Vector{QuantumClifford.AbstractOperation}:
sCNOT(12,6)
sCNOT(12,7)
sCNOT(12,11)
sCNOT(18,6)
sCNOT(18,8)
sCNOT(18,11)
sCNOT(19,8)
sCNOT(19,9)
sCNOT(20,6)
sCNOT(20,8)
sCNOT(20,9)
sCNOT(20,10)
sCNOT(20,11)
sCNOT(21,8)
sCNOT(21,9)
sCNOT(21,10)
sCNOT(21,11)
⋮
sZCX(3,17)
sHadamard(4)
sZCX(4,6)
sZCX(4,9)
sZCX(4,12)
sZCX(4,13)
sZCX(4,14)
sZCX(4,15)
sZCX(4,16)
sHadamard(5)
sZCX(5,7)
sZCX(5,10)
sZCX(5,13)
sZCX(5,14)
sZCX(5,15)
sZCX(5,16)
sZCX(5,17)
parity_checks(c::QuantumGolay) = S"X_X__X__XXXXX__________
XXXX_XX_X____X_________
_XXXX_XX_X____X________
__XXXX_XX_X____X_______
___ZZZZ_ZZ_Z____Z______
Z_Z_Z_ZZZ__Z_____Z_____
ZZZZ___Z__ZZ______Z____
ZZ_ZZZ___ZZ________Z___
_ZZ_ZZZ___ZZ________Z__
Z__Z__ZZZZZ__________Z_
_Z__Z__ZZZZZ__________Z"
julia> naive_encoding_circuit(s9)
68-element Vector{QuantumClifford.AbstractOperation}:
sCNOT(12,5)
sCNOT(12,6)
sCNOT(12,10)
sCNOT(12,11)
sCNOT(17,5)
sCNOT(17,7)
sCNOT(17,10)
sCNOT(18,5)
sCNOT(18,6)
sCNOT(18,7)
sCNOT(18,8)
sCNOT(18,10)
sCNOT(18,11)
sCNOT(19,5)
sCNOT(19,7)
sCNOT(19,8)
sCNOT(19,9)
⋮
sZCX(2,16)
sHadamard(3)
sZCX(3,5)
sZCX(3,8)
sZCX(3,11)
sZCX(3,12)
sZCX(3,13)
sZCX(3,14)
sZCX(3,15)
sHadamard(4)
sZCX(4,6)
sZCX(4,9)
sZCX(4,12)
sZCX(4,13)
sZCX(4,14)
sZCX(4,15)
sZCX(4,16)
parity_checks(c::QuantumGolay) = S"Z_Z__Z__ZZZZZ__________
ZZZZ_ZZ_Z____Z_________
_ZZZZ_ZZ_Z____Z________
__ZZZZ_ZZ_Z____Z_______
___ZZZZ_ZZ_Z____Z______
Z_Z_Z_ZZZ__Z_____Z_____
ZZZZ___Z__ZZ______Z____
ZZ_ZZZ___ZZ________Z___
_ZZ_ZZZ___ZZ________Z__
Z__Z__ZZZZZ__________Z_
_Z__Z__ZZZZZ__________Z"
julia> naive_encoding_circuit(s)
77-element Vector{QuantumClifford.AbstractOperation}:
sCNOT(12,1)
sCNOT(12,2)
sCNOT(12,6)
sCNOT(12,7)
sCNOT(12,8)
sCNOT(12,10)
sCNOT(13,2)
sCNOT(13,3)
sCNOT(13,7)
sCNOT(13,8)
sCNOT(13,9)
sCNOT(13,11)
sCNOT(14,1)
sCNOT(14,2)
sCNOT(14,3)
sCNOT(14,4)
sCNOT(14,6)
⋮
sCNOT(21,5)
sCNOT(21,8)
sCNOT(21,10)
sCNOT(21,11)
sCNOT(22,1)
sCNOT(22,4)
sCNOT(22,7)
sCNOT(22,8)
sCNOT(22,9)
sCNOT(22,10)
sCNOT(22,11)
sCNOT(23,1)
sCNOT(23,5)
sCNOT(23,6)
sCNOT(23,7)
sCNOT(23,9)
sCNOT(23,11)
parity_checks(c::QuantumGolay) = S"X_X__X__XXXXX__________
XXXX_XX_X____X_________
_XXXX_XX_X____X________
__XXXX_XX_X____X_______
___XXXX_XX_X____X______
X_X_X_XXX__X_____X_____
XXXX___X__XX______X____
XX_XXX___XX________X___
_XX_XXX___XX________X__
X__X__XXXXX__________X
_X__X__XXXXX__________X"
julia> naive_encoding_circuit(s1)
88-element Vector{QuantumClifford.AbstractOperation}:
sHadamard(1)
sZCX(1,12)
sZCX(1,14)
sZCX(1,17)
sZCX(1,20)
sZCX(1,21)
sZCX(1,22)
sZCX(1,23)
sHadamard(2)
sZCX(2,12)
sZCX(2,13)
sZCX(2,14)
sZCX(2,15)
sZCX(2,17)
sZCX(2,18)
sZCX(2,20)
sHadamard(3)
⋮
sZCX(9,23)
sHadamard(10)
sZCX(10,12)
sZCX(10,15)
sZCX(10,18)
sZCX(10,19)
sZCX(10,20)
sZCX(10,21)
sZCX(10,22)
sHadamard(11)
sZCX(11,13)
sZCX(11,16)
sZCX(11,19)
sZCX(11,20)
sZCX(11,21)
sZCX(11,22)
sZCX(11,23)
Should I add [[23, 1, 7]] quantum Golay code here as well?
On a second note, I think it's better to have this PR based on classical Golay codes. It's better for organization purpose and easy to track the changes.
Thanks for helpful comments. Improvements include:
echelon_form
from Nemo is used in the tests as well!
There are two members of classical Golay Binary codes in the literature, namely the [[24, 12, 8]] and [[23, 12, 7]]. The latter can be obtained by puncturing the former. The former is described via Huffman construction method.