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

ERROR: MethodError: no method matching polynomial_ring(::ZZRing, ::Tuple{Symbol, Symbol}) #21

Closed
cyanreg opened this issue Feb 13, 2024 · 12 comments
Assignees

Comments

@cyanreg
Copy link

cyanreg commented Feb 13, 2024

Happens when calling LDPCCode() with any matrix given as an argument.

Also, the examples haven't been updated yet either.

Replicatable on both the master and QWRv1 on Julia v1.10

@esabo
Copy link
Owner

esabo commented Feb 13, 2024

Yeah, this is due to an update in a dep. I fixed it the other day on the dev branch, which also contains some fixes for other bugs introduced by the update. Please use dev until merged into master.

By examples you are referring to the documentation? That takes significant time to write and hasn't been done yet. On the list...

@cyanreg
Copy link
Author

cyanreg commented Feb 14, 2024

I get the error on dev too:

julia> regular_LDPC_code(20, 20, 20)
ERROR: MethodError: no method matching polynomial_ring(::Nemo.ZZRing, ::Tuple{Symbol, Symbol})

I think I'm using dev, tried both Pkg.add(url="here#dev") and rev="dev" arguments.

At least something changed, I'm not seeing GF defined anymore.

@esabo
Copy link
Owner

esabo commented Feb 14, 2024

Huh... that polynomial ring should be univariate. It sounds like you are on branch up_deps. GF is still in dev and it should be PolynomialRing instead of the new polynomial_ring in up_deps.

julia> regular_LDPC_code(20, 20, 20)
[20, 19, 2]_2 regular (20, 20)-LDPC code with density 1.0.

Variable degree polynomial:
        1//20*x^20
Check degree polynomial:
        1//20*x^20
Parity-check matrix: 20 × 20
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

This function is out of a textbook, but I have not written any unit tests for it, so let me know if there's anything weird about it. You may also submit tests...

Either way, when I finish with getting the tests to recognize the new extension I made, I will pull dev into master to fix this.

@cyanreg
Copy link
Author

cyanreg commented Feb 14, 2024

Nope, went as far as cloning to a local repo, merging dev into master, deleting every other branch and adding it via Pkg.add(path), still getting the same error. Is Pkg pulling some old dependencies?

@esabo
Copy link
Owner

esabo commented Feb 14, 2024

I've merged the fixes from dev into master. I'd say delete, try master again, and if it fails, please post the full stack trace.

@cyanreg
Copy link
Author

cyanreg commented Feb 14, 2024

On a fresh install with empty .julia directory. Full log attached: logfile.txt

@benide
Copy link
Collaborator

benide commented Feb 14, 2024

From your log it seems you're not using the Manifest.toml. Make sure you haven't updated that file and run instantiate in the package REPL from within the project environment.

@benide
Copy link
Collaborator

benide commented Feb 14, 2024

I was trying to find how to add it as a package while bringing in the manifest, but I'm not sure how that's done. We need to add some things to [compat] in Project.toml I think to make things work smoothly.

@esabo
Copy link
Owner

esabo commented Feb 14, 2024

Ah, I see. The offending line is Installed Oscar ──────────────────────────── v0.14.0. As Ben said, this is ignoring the Manifest file. I believe I have fixed it now by adding explicit version numbers to the Project file.

I didn't see why it would break in the function you specified, but the stacktrace shows it breaks in another function called by that, which makes sense. The Oscar v13 -> v14 update was a major breaking update. In this instance, v13 requires inputs to polynomial_ring in the form (:x, :y), but v14 now requires [:x, :y]. These changes are currently being made in the up_deps branch.

@esabo
Copy link
Owner

esabo commented Feb 14, 2024

and to get GF you need using Oscar

@benide
Copy link
Collaborator

benide commented Feb 14, 2024

The upshot is, @cyanreg, give Pkg.add(url="https://github.com/esabo/CodingTheory") another shot. It might work directly now without extra intervention.

@cyanreg
Copy link
Author

cyanreg commented Feb 14, 2024

Thanks, everything works fine now.

@cyanreg cyanreg closed this as completed Feb 14, 2024
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

No branches or pull requests

3 participants