Infleqtion / qLDPC

Tools for constructing and analyzing quantum low density parity check (qLDPC) codes.
Apache License 2.0
74 stars 8 forks source link

Random methods #16

Closed mittaltushant closed 6 months ago

mittaltushant commented 7 months ago

Added module to generate and test

  1. Random Base Codes — Linear and Hamming
  2. Random Cyclic Quantum Tanner Codes
  3. Random Quantum Tanner Codes over SL(q,d)
perlinm commented 6 months ago

So I haven't figured out what is going on or why, but the following code:

from qldpc import codes

dims = (30, 6)
terms_a = [("x", 9), ("y", 1), ("y", 2)]
terms_b = [("y", 3), ("x", 25), ("x", 26)]
code = codes.QCCode(dims, terms_a, terms_b)

for _ in range(10):
    print("distance: <=", code.get_distance(upper=True))

consistently finds distances <= 12 on main, but on this branch mostly finds <= 30 with occasional <= 16 or <= 14. So something funny is going on...

perlinm commented 6 months ago

Ah, I think I figured it out: changing ensure_nontrivial: bool = True to ensure_nontrivial: bool = False here seems to fix it.

@mittaltushant do you think it's fine to make this change? Technically it changes the experiments you've been running, but if you haven't been setting and tracking random number seeds at the distance calculation step for those experiments then I think it doesn't really matter.

perlinm commented 6 months ago

Actually, I can no longer reproduce issue I was talking about in the above comments. I now pretty much always get distances >= 30. So I need to do some digging.

perlinm commented 6 months ago

Closing. Everything here except random_methods.py has been merged into main through PRs #21 and #22, and random_methods.py is in any case updated on the experiment_cyclic_hamming branch.