-
Notifications
You must be signed in to change notification settings - Fork 68
Added BP-OTS decoder implementation in LDPCDecodersExt file #489
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
base: master
Are you sure you want to change the base?
Conversation
Krastanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed in meeting:
- Project.toml should have a new compat bount
- bumping version in Project.toml
- CHANGELOG
- tests
| end | ||
|
|
||
| #parity_checks method | ||
| function parity_checks(d::BPOTSWrapperDecoder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed repetition in the latest commit
| errorrate = isnothing(errorrate) ? 0.0 : errorrate | ||
| maxiter = isnothing(maxiter) ? n : maxiter | ||
| bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) | ||
| bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) # uses 2 classical bit flip decoders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not modify unrelated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the change that was made by me
| # Make sure to also implement the parity_checks method | ||
| function parity_checks(d::BPOTSWrapperDecoder) | ||
| return d.H | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this repetition
| # In QuantumCliffordLDPCDecodersExt.jl | ||
| # Here's the fixed BPOTSWrapperDecoder implementation for your extension module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments left over from asking the coding assistant for stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed extra comments
|
|
||
| # In QuantumCliffordLDPCDecodersExt.jl | ||
| # Here's the fixed BPOTSWrapperDecoder implementation for your extension module | ||
| struct BPOTSWrapperDecoder <: AbstractSyndromeDecoder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BPOTSDecoder just for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed name to BPOTSDecoder
|
you can add tests here QuantumClifford.jl/test/test_ecc_decoder_all_setups.jl Lines 67 to 83 in 5341f9d
|
Krastanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! There seems to be a small typo.
Could you also add a test, e.g. by including your decoder in this list https://github.com/QuantumSavory/QuantumClifford.jl/blob/master/test/test_ecc_decoder_all_setups.jl#L83
|
@adhirajj just a bump, let me know if you would not have a chance to look into finishing this PR |
|
@adhirajj , could you check what is necessary to finish this PR? It seems the tests are still failing |
| end | ||
|
|
||
| function decode(d::BPOTSDecoder, syndrome_sample::AbstractVector{Bool}) | ||
| # Validate input size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments that are just a obvious statement, comments should provide insight about the code, not state things that are already obvious
| if c isa Toric || c isa Surface | ||
| k = c isa Toric ? 2 : 1 | ||
| else | ||
| k = n - s | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a fragile piece of code, why are these special cased? Probably should use code_k code_n code_c functions.
CHANGELOG.md
Outdated
| ### Added | ||
| - BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder for quantum LDPC codes in the LDPCDecoders extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check how this looks like on master and format it similarly
Project.toml
Outdated
| HostCPUFeatures = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" | ||
| ILog2 = "2cd5bd5f-40a1-5050-9e10-fc8cdb6109f5" | ||
| InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
| LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be moved back to a weak dependency
| Chytas et al., "Enhanced Message-Passing Decoding of Degenerate Quantum Codes | ||
| Utilizing Trapping Set Dynamics", IEEE Communications Letters, 2024 | ||
| """ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this empty line makes the docstring not attach to the struct
| bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) | ||
| bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) | ||
| bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo the permutation
If you want to submit an unfinished piece of work in order to get comments and discuss, please mark the pull request as a draft and ping the repository maintainer.
Please address only one topic or issue per pull request! Many small PRs are much easier to review and merge than one large PR.
Before merging, all changes and new functionality should be marked in the CHANGELOG file, but feel free to just leave your CHANGELOG notes in the PR description, to avoid merge conflicts with other requests modifying that file. The maintainer will add these CHANGELOG notes for you if you do so.
Before considering your pull request ready for review and merging make sure that all of the following are completed (please keep the clecklist as part of your PR):
If possible, keep your git history not too wild (rebase and squash commits, keep commits small and semantically separated) so that review is easier.