Skip to content

Conversation

@adhirajj
Copy link

@adhirajj adhirajj commented Apr 8, 2025

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):

  • 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.

If possible, keep your git history not too wild (rebase and squash commits, keep commits small and semantically separated) so that review is easier.

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.

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)
Copy link
Member

Choose a reason for hiding this comment

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

repeated

Copy link
Author

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
Copy link
Member

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

Copy link
Author

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
Copy link
Member

Choose a reason for hiding this comment

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

repeated

Copy link
Author

Choose a reason for hiding this comment

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

removed this repetition

Comment on lines 33 to 34
# In QuantumCliffordLDPCDecodersExt.jl
# Here's the fixed BPOTSWrapperDecoder implementation for your extension module
Copy link
Member

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

Copy link
Author

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
Copy link
Member

Choose a reason for hiding this comment

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

BPOTSDecoder just for consistency

Copy link
Author

Choose a reason for hiding this comment

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

changed name to BPOTSDecoder

@Krastanov
Copy link
Member

you can add tests here

@testset "BitFlipDecoder decoder, good for sparse codes" begin
codes = [
QuantumReedMuller(3),
QuantumReedMuller(4)
]
noise = 0.001
setups = [
CommutationCheckECCSetup(noise),
NaiveSyndromeECCSetup(noise, 0),
ShorSyndromeECCSetup(noise, 0),
]
for c in codes
for s in setups
for d in [c->BitFlipDecoder(c, maxiter=10)]

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.

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

@Krastanov Krastanov closed this Apr 29, 2025
@Krastanov Krastanov reopened this Apr 29, 2025
@Krastanov
Copy link
Member

@adhirajj just a bump, let me know if you would not have a chance to look into finishing this PR

@Fe-r-oz Fe-r-oz added enhancement New feature or request ECC Having to do with the ECC submodule labels May 1, 2025
@Krastanov
Copy link
Member

@adhirajj , could you check what is necessary to finish this PR? It seems the tests are still failing

@Krastanov Krastanov marked this pull request as draft May 24, 2025 01:37
end

function decode(d::BPOTSDecoder, syndrome_sample::AbstractVector{Bool})
# Validate input size
Copy link
Member

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

Comment on lines 75 to 79
if c isa Toric || c isa Surface
k = c isa Toric ? 2 : 1
else
k = n - s
end
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 fragile piece of code, why are these special cased? Probably should use code_k code_n code_c functions.

CHANGELOG.md Outdated
Comment on lines 8 to 9
### Added
- BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder for quantum LDPC codes in the LDPCDecoders extension
Copy link
Member

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

@adhirajj adhirajj marked this pull request as ready for review October 14, 2025 16:49
@adhirajj adhirajj requested a review from Krastanov October 14, 2025 18:15
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"
Copy link
Member

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
"""

Copy link
Member

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

Comment on lines 68 to 152
bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter)
bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter)
bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter)
Copy link
Member

Choose a reason for hiding this comment

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

undo the permutation

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 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants