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

examples of generalized bicycle codes #389

Merged
merged 5 commits into from
Nov 5, 2024

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Oct 14, 2024

This PR aims to add tests for 2BGA codes from Reference. Table 1: https://arxiv.org/pdf/2306.16400. I have verified all the appropriate code instance using this new method as well. I have created a test file for this as well.

@royess, just pinging you for reference.

Also, there was a typo, 2GBA was used, instead of 2BGA, fixed this as well.

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.
  • We recently started enforcing formatting checks. If formatting issues are reported in the new code you have written, please correct them. There will be plenty of old code that is flagged as we are slowly transitioning to enforced formatting. Please do not worry about or address older formatting issues -- keep your PR just focused on your planned contribution.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.07%. Comparing base (40924b8) to head (693b5ba).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #389      +/-   ##
==========================================
+ Coverage   83.00%   83.07%   +0.06%     
==========================================
  Files          71       71              
  Lines        4560     4560              
==========================================
+ Hits         3785     3788       +3     
+ Misses        775      772       -3     

☔ 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 Oct 14, 2024

This is good to go from my POV @Krastanov

P.S. The failing tests are unrelated to this PR.

@royess
Copy link
Contributor

royess commented Oct 14, 2024

I think there is already a generalized_bicycle_codes that does exactly the same thing. So I do not get the point why we need this.

@Fe-r-oz Fe-r-oz force-pushed the missing2bgaconstructor branch 2 times, most recently from 8a308a4 to b0fbb53 Compare October 14, 2024 10:58
@Fe-r-oz Fe-r-oz changed the title add missing method for two-block group algebra (2BGA) codes adding test cases for two-block group algebra (2BGA) codes Oct 14, 2024
@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Oct 14, 2024

Oh... My bad. I knew this fact, but somehow overlooked it because working on two separate things simultaneously.

Rebased this PR fixing the typo and verifying the test cases from aforementioned paper. Thanks.

@Fe-r-oz Fe-r-oz changed the title adding test cases for two-block group algebra (2BGA) codes adding all test cases for two-block group algebra (2BGA) codes and fix typo Oct 14, 2024
@Fe-r-oz Fe-r-oz changed the title adding all test cases for two-block group algebra (2BGA) codes and fix typo adding all test cases for abelian two-block group algebra (2BGA) codes and fix typo Oct 14, 2024
@Fe-r-oz Fe-r-oz changed the title adding all test cases for abelian two-block group algebra (2BGA) codes and fix typo Reproduce Table 1 Block 1 and Block 3 results of H.K.Lin for 2BGA codes for abelian groups and fix typo Oct 16, 2024
@Fe-r-oz Fe-r-oz changed the title Reproduce Table 1 Block 1 and Block 3 results of H.K.Lin for 2BGA codes for abelian groups and fix typo fix typo and add doctests and tests for 2BGA codes as GB codes for abelian groups Oct 18, 2024
@Fe-r-oz Fe-r-oz changed the title fix typo and add doctests and tests for 2BGA codes as GB codes for abelian groups Add tests to verify 2BGA as subset of GB code for abelian group Oct 19, 2024
@Fe-r-oz Fe-r-oz changed the title Add tests to verify 2BGA as subset of GB code for abelian group Add tests to verify 2BGA as subset of GB code for cyclic group Oct 19, 2024
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 is a great addition, thank you! I am a bit confused about where it is placed. Would it not make more sense in generalized_bicycle_codes?

Comment on lines 1 to 16
@testitem "ECC 2BGA" begin
using Hecke
using QuantumClifford.ECC: generalized_bicycle_codes, code_k, code_n

# codes taken from Table 1 of [lin2024quantum](@cite)
@test code_n(generalized_bicycle_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 70
@test code_k(generalized_bicycle_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 8
@test code_n(generalized_bicycle_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 54
@test code_k(generalized_bicycle_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 6
@test code_n(generalized_bicycle_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 60
@test code_k(generalized_bicycle_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 6
@test code_n(generalized_bicycle_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 72
@test code_k(generalized_bicycle_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 8
@test code_n(generalized_bicycle_codes([0 , 9, 28, 13], [0 , 1, 21, 34], 36)) == 72
@test code_k(generalized_bicycle_codes([0 , 9, 28, 13], [0 , 1, 3, 22], 36)) == 10
end
Copy link
Member

Choose a reason for hiding this comment

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

I am a bit confused: these are "generalized_bicycle_codes". Shouldn't the test file be called "test_ecc_generalized_bicycle_codes.jl"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right.

Comment on lines 145 to 156
[[70, 8, 10]] 2BGA code from Table 1 of [lin2024quantum](@cite) with cyclic group of
order `l = 35`.

```jldoctest
julia> l = 35;

julia> c1 = generalized_bicycle_codes([0, 15, 16, 18], [0, 1, 24, 27], l);

julia> code_n(c1), code_k(c1)
(70, 8)
```

Copy link
Member

Choose a reason for hiding this comment

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

This seems like a docstring that should go in the function generalized_bicycle_codes, not in two_block_group_algebra_codes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Let's put in docstring of BG codes.

In addition, GB codes are a subset of only abelian 2BGA codes. 2BGA codes are formed by a general, finite group. Also, this test is rather relaxed in a sense that this is not a test for 2BGA codes, only abelian version of 2BGA and also because the original paper used small groups to create 2BGA codes which is done in #406, and this is more like a subset test for GB codes.

@Fe-r-oz Fe-r-oz changed the title Add tests to verify 2BGA as subset of GB code for cyclic group tests: verify that Abelian 2BGA code can be viewed as GB code Nov 5, 2024
@Krastanov Krastanov changed the title tests: verify that Abelian 2BGA code can be viewed as GB code examples of generalized bicycle codes Nov 5, 2024
@Krastanov
Copy link
Member

Thank you! I think I have now merged most of the batch of examples you have provided. Much appreciated!

I will continue with reviews later in the week.

@Krastanov Krastanov merged commit c3aa055 into QuantumSavory:master Nov 5, 2024
13 of 16 checks passed
@Fe-r-oz Fe-r-oz deleted the missing2bgaconstructor branch November 5, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants