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

Broken promotions #459

Closed
8d1h opened this issue Jul 13, 2021 · 5 comments · Fixed by #461
Closed

Broken promotions #459

8d1h opened this issue Jul 13, 2021 · 5 comments · Fixed by #461
Assignees

Comments

@8d1h
Copy link
Contributor

8d1h commented Jul 13, 2021

I updated Singular and some promotions are broken
https://github.com/8d1h/IntersectionTheory/runs/3060958843?check_suite_focus=true

julia> Singular.Nemo.QQ(1) * Singular.PolynomialRing(Singular.QQ, ["a"])[2][1]
ERROR: Cannot promote to common type
Stacktrace:
 [1] *(x::Nemo.fmpq, y::spoly{n_Q})
   @ AbstractAlgebra ~/.julia/packages/AbstractAlgebra/hlSYb/src/Rings.jl:83

I guess this is due to Nemocas/AbstractAlgebra.jl#927

@thofma
Copy link
Collaborator

thofma commented Jul 14, 2021

Thanks for the report. I will have a look.

@thofma thofma self-assigned this Jul 14, 2021
@thofma
Copy link
Collaborator

thofma commented Jul 14, 2021

Where do you need this? I am a bit hesitant to add it.

@8d1h
Copy link
Contributor Author

8d1h commented Jul 14, 2021

It's just for convenience (and it worked before...) I can always add it manually in my package.

Also coercion works already so it makes sense to allow promotion

julia> R = Singular.PolynomialRing(Singular.QQ, ["x"])[1];

julia> R(Singular.Nemo.QQ(1//2))
1//2

@thofma
Copy link
Collaborator

thofma commented Jul 14, 2021

Yes, I understand. If we add a promote rule, it will be called automatically. For fmpq and spoly{n_Q} it is fine, but do you also want fmpq and n_Q? I am not sure want this, because it is not clear what the type of the result should be.

@8d1h
Copy link
Contributor Author

8d1h commented Jul 14, 2021

I agree. fmpq and n_Q should not be allowed. (I just saw the code for spoly promotion...)

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 a pull request may close this issue.

2 participants