Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[2ᵐ - 1, 1, 3]] quantum Reed-Muller code #302

Merged
merged 15 commits into from
Sep 27, 2024

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Jun 30, 2024

Initial Results

goal: implement most things from the paper as part of testing. I am waiting for RecursiveReedMuller to be reviewed so that I can use it to built these codes.

julia> parity_checks(QuantumReedMuller(4))
+ X_X_X_X_X_X_X_X
+ _XX__XX__XX__XX
+ ___XXXX____XXXX
+ _______XXXXXXXX
+ Z___Z___Z___Z__
+ _Z___Z___Z___Z_
+ __Z___Z___Z___Z
+ ___ZZZZ____ZZZZ
+ ____Z_Z_____Z_Z
+ _____ZZ______ZZ
+ _______ZZZZZZZZ
+ ________Z_Z_Z_Z
+ _________ZZ__ZZ
+ ___________ZZZZ

julia> parity_checks(Steane7())
+ ___XXXX
+ _XX__XX
+ X_X_X_X
+ ___ZZZZ
+ _ZZ__ZZ
+ Z_Z_Z_Z

julia> parity_checks(QuantumReedMuller(3))
+ X_X_X_X
+ _XX__XX
+ ___XXXX
+ Z_Z_Z_Z
+ _ZZ__ZZ
+ ___ZZZZ

julia> canonicalize!(parity_checks(Steane7())) ==  parity_checks(QuantumReedMuller(3))
true

Construction Method Followed from the paper, It looks like

julia> RM13 = generator(RecursiveReedMuller(1, 3));

julia> RM23 = generator(RecursiveReedMuller(3 - 2, 3));

julia> QRM_steane = CSS(RM13[2:end, 2:end], RM23[2:end, 2:end])
CSS(Bool[1 0 … 0 1; 0 1 … 1 1; 0 0 … 1 1], Bool[1 0 … 0 1; 0 1 … 1 1; 0 0 … 1 1])

julia> Steane = Stabilizer(QRM_steane)
+ X_X_X_X
+ _XX__XX
+ ___XXXX
+ Z_Z_Z_Z
+ _ZZ__ZZ
+ ___ZZZZ

Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 9 lines in your changes missing coverage. Please review.

Project coverage is 82.79%. Comparing base (dddaedb) to head (65f8a2c).
Report is 8 commits behind head on master.

Files Patch % Lines
src/ecc/codes/classical/recursivereedmuller.jl 65.21% 8 Missing ⚠️
src/ecc/codes/quantumreedmuller.jl 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
- Coverage   82.85%   82.79%   -0.06%     
==========================================
  Files          60       62       +2     
  Lines        3971     4010      +39     
==========================================
+ Hits         3290     3320      +30     
- Misses        681      690       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Jun 30, 2024

PyMatching Decoder should not be used for QRM codes.

Please check out the decoder graphs for these codes!

BeliefPropDecoder
display

Table Decoder
display

More Samples

display

@Fe-r-oz Fe-r-oz changed the title [[2ᵐ - 1, 1, 3]] quantum Reed-Muller code [[2ᵐ - 1, 1, 3]] quantum Reed-Muller code Jul 22, 2024
@Krastanov Krastanov added the ECC Having to do with the ECC submodule label Aug 3, 2024
@Fe-r-oz Fe-r-oz force-pushed the qrm branch 6 times, most recently from 3ebf2d8 to fcd3cb5 Compare September 20, 2024 05:08
@Fe-r-oz Fe-r-oz marked this pull request as ready for review September 20, 2024 05:47
@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Sep 20, 2024

The PR is now ready for review, Thank you!

@Krastanov Krastanov self-requested a review September 27, 2024 03:57
Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great addition and pretty close to ready for merge (hopefully the test change I made did not break anything -- these were meant as stylistic changes mostly).

I think there is only one thing left to do. You showed that the belief propagation decoder seems to work well for this code. Let's add it to the list of codes that are actually tested with the belief propagation decoder.

src/ecc/codes/quantumreedmuller.jl Outdated Show resolved Hide resolved
@@ -28,7 +28,7 @@
@test code_n(QuantumReedMuller(m)) == 2^m - 1
@test code_k(QuantumReedMuller(m)) == 1
@test distance(QuantumReedMuller(m)) == 3
@test H == parity_checks(CSS(parity_checks_x(QuantumReedMuller(m)), parity_checks_z(QuantumReedMuller(m))))
@test H == stab_to_gf2(parity_checks(CSS(parity_checks_x(QuantumReedMuller(m)), parity_checks_z(QuantumReedMuller(m)))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good catch

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Sep 27, 2024

BitFlipDecoder gives better results than BeliefPropDecoder. There were a lot of assertion errors when comparing max(e...) < noise/4 for BeliefPropDecoder so instead I added BitFlipDecoder that gives better results. Hope this is satisfactory, I this is ready for review. Thank you!

display

display

julia> mem_errors = 0.001:0.005:0.1;
julia> codes = [QuantumReedMuller(3), QuantumReedMuller(4), QuantumReedMuller(5)];
julia> results = zeros(length(codes), length(mem_errors), 2);
julia> for (ic, c) in pairs(codes)
           for (i,m) in pairs(mem_errors)
               setup = ShorSyndromeECCSetup(m, 0)
               decoder = BitFlipDecoder(c)
               r = evaluate_decoder(decoder, setup, 1000)
               results[ic,i,:] .= r
           end
       end
julia> make_decoder_figure(mem_errors, results, "QRM(3), QRM(4), QRM(5) code with a BitFlipDecoder decoder")
julia> for (ic, c) in pairs(codes)
           for (i,m) in pairs(mem_errors)
               setup = ShorSyndromeECCSetup(m, 0)
               decoder = BeliefPropDecoder(c)
               r = evaluate_decoder(decoder, setup, 1000)
               results[ic,i,:] .= r
           end
       end
julia> make_decoder_figure(mem_errors, results, "QRM(3), QRM(4), QRM(5) code with a BeliefPropDecoder decoder")

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Sep 27, 2024

Thanks for polishing the PR. That is very much appreciated!

@Fe-r-oz Fe-r-oz requested a review from Krastanov September 27, 2024 12:00
@Krastanov Krastanov merged commit f420834 into QuantumSavory:master Sep 27, 2024
15 of 16 checks passed
@Fe-r-oz Fe-r-oz deleted the qrm branch September 27, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECC Having to do with the ECC submodule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants