XQP-Munich / LDPC4QKD

Rate adaptive LDPC based solutions for distributed source coding
GNU General Public License v3.0
21 stars 10 forks source link

Creating new codes #15

Closed Matio7k closed 10 months ago

Matio7k commented 1 year ago

I really appreciate your repository because it is very helpful for my work. I have a question about creating new LDPC codes.

You provided some codes in .cscmat format. I would like to make more codes and compare them. Do you have an idea how can I do it?

adomasbaliuka commented 1 year ago

I have decided that .cscmat was not a well-thought-out format and I don't recommend using it. Instead, we will be using two different formats: the old .alist and a new custom format based on JSON, which allows adding meta-information easily. The branch feature/automatic_benchmarks_and_plots is already using the new format. Our helper project LDPCStorage.jl can be used to convert between the formats.

Making new LDPC codes can be quite involved and we won't be able to open source that part of the process right now. I'm trying some new things though and will be making some additional LDPC codes for very different rates soon. Maybe those will satisfy your needs?

If you want to make LDPC codes yourself, you might want to take a look at the progressive edge growth algorithm, as well as some of the references on our old poster.

Matio7k commented 1 year ago

Thank you for your answer. I am looking actually for a way to make good irregular parity-check matrices, which will have a threshold close to Shannon capacity of the binary-symmetric-channel (about 11%). I need to have bigger sizes of such codes, e.g. 100 000 bits of encoded sequence. In this case progressive edge growth algorithm fails, because of the matrix size. Maybe you have a suggestion about what I can try.

Different rates of codes would be interesting for me, but not at the moment.

adomasbaliuka commented 1 year ago

It's absolutely possible to use PEG for code sizes above 100k, I've done it. Just takes days to run.

Do I understand correctly that you actually want BEC(11%)? Error rates this high aren't really of interest for us so we don't have codes for them. I'm working on some codes right now that should include working up to 10% (at rate 1/2). The big code already in this repository works up to 9.5%.

I don't think you'll be able to work at 11% with rate 1/2, so you need to go even further with the rate. Making protographs for that range would be hard and I probably can't justify the effort to try it. Do you have degree distributions for the range?

Matio7k commented 1 year ago

By the binary-symmetric-channel, I understand the channel with some probability of the bit-flip. I am not considering BEC where bits are erased. I would like to have a code which can decode with Belief-Propagation BSC(10-11%) rate 1/2. I am basing on the reference: (https://doi.org/10.1109/18.910578) where in the example 2 is given the degree distribution which has the threshold 10.6%. I would like to check this threshold for different sizes of codes. I do not know what is the best way to create such an irregular parity-check matrix.

adomasbaliuka commented 1 year ago

Sorry, "BEC" was a typo, I meant BSC...

The main point of the codes currently in the repository is to optimize for good rate-adaptability at the cost of a bit worse best-case performance.

I will have a few rate 1/2 codes coming up in the next 1-2 weeks, which I hope will be better than the one already in the repository, so stay tuned. Maybe it will be enough for 10%, I wouldn't hope for >10%, as I said, this is not a range of error rates that we focus on. Note that, depending on how threshold are calculated, really achieving them in practice isn't always possible.

Matio7k commented 1 year ago

Thank you very much for these comments! I will check your upcoming rate 1/2 codes.

adomasbaliuka commented 1 year ago

Well, I have a code that has a block size of 800k at rate 1/2 and has FER~15% @ BSC(9.9%). Not quite what you wanted? Some still bigger ones are in the making but I'm not very confident they will be usable above BSC(10%)

Matio7k commented 1 year ago

Very nice! Will you make this code public? Can you just provide the proto-matrix? It would be easier, I think.

XQP-Munich commented 1 year ago

I uploaded the code in the development branch. It won't be merged before some other stuff is ready but you can access it already.

https://github.com/XQP-Munich/LDPC4QKD/blob/5c977fdd18abb91460f197ed8918bc1bc17efc84/codes/ldpc/rate_0.5/block_819200_pegqc.qccsc.json

There's also an aff3ct simulation (same commit) but it doesn't contain enough simulated frames at interesting error rates to call it final.

Matio7k commented 1 year ago

Thank you very much! Are you able to provide the protomatrix of this code?

adomasbaliuka commented 1 year ago

There is no protomatrix, it was created using PEG on a degree distribution (the rate 1/2 one from arXiv:0901.2140v1) and then applying the QC-lifting procedure. I will document this more carefully once I upload everything.