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

fix: random circuit codes are non-CSS so return iscss(...) = false instead of nothing #463

Closed
wants to merge 1 commit into from

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Jan 20, 2025

Hi, @royess, The random_circuit codes are non-CSS so, I am wondering why the iscss(::Type{...}) returns nothing. Shouldn't it return false? Hopefully, that is not a bad proposition?

Could you explain if it was a typo or there is some reason behind it? Thanks! I agree with you that codes are non-CSS.

BP and BP-OSD in PyQDecoders.jl (PyMatchingDecoder ) are not applicable to random circuit codes because they are non-CSS.

iscss(::Type{CircuitCode}) = nothing

Bravyi introduces a Mixed Integer Programming for CSS/QLDPC codes so his approach don't work for non-CSS codes. Hence, I want to exclude non-CSS codes so user does not end up calculating distance for non-CSS codes which throw solver error.

iscss(::Type{...}) = false would be helpful here because in a later PR, I want to do something like

function distance(c::AbstractECC; kwargs...)
    if !iscss(c)
        throw(ArgumentError("Computing the minimum distance of QLDPC using Mixed Integer Programming works only for CSS codes."))
    end
    return distance(parity_checks(c); kwargs...)
end

@Krastanov, Please help review this PR, Thank you!

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

@royess
Copy link
Contributor

royess commented Jan 21, 2025

@Krastanov and I discussed this during PR. The reason is that random circuit codes are not necessarily CSS but could still possibly be CSS.

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Jan 21, 2025

There are a couple of instances, such as in bullet point 2 of the notes in the introductory message and in the line I quoted above, where you mention that these codes are non-CSS. I also reviewed the comments and all your messages posted in the PR.

I will let Stefan decide the fate of this PR.

@royess
Copy link
Contributor

royess commented Jan 21, 2025

Let me clarify more: CircuitCode's are non-CSS in general. (That is what I meant in the sentences you quoted.) But some instances of them could be CSS.

Therefore, iscss(::Type{CircuitCode}) is undetermined, for which we assign nothing. If we return false all the time, we will make mistakes in these CSS instances.

Regarding your later PR: Does it make sense that you also exclude nothing when trying to calculate the code distance?

@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Jan 21, 2025

Thanks! Yeah, I can try checking !iscss(...) and also check if nothing which can also work and also does not change anything here. The PR is #439, it's a previous PR, but I ended up saying it's a later PR.

I will close this PR to be safe.

@Fe-r-oz Fe-r-oz closed this Jan 21, 2025
@Fe-r-oz Fe-r-oz deleted the fa/fix-typo branch January 21, 2025 03:59
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.

2 participants