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

algebraic_closure of finite field cannot be copied #38988

Open
2 tasks done
user202729 opened this issue Nov 17, 2024 · 1 comment · May be fixed by #38994
Open
2 tasks done

algebraic_closure of finite field cannot be copied #38988

user202729 opened this issue Nov 17, 2024 · 1 comment · May be fixed by #38994
Labels

Comments

@user202729
Copy link
Contributor

Steps To Reproduce

sage: deepcopy(GF(5).algebraic_closure())
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: sage.misc.fast_methods.WithEqualityById.__new__(AlgebraicClosureFiniteField_pseudo_conway_with_category) is not safe, use AlgebraicClosureFiniteField_pseudo_conway_with_category.__new__()

Expected Behavior

should just work

Actual Behavior

error

Additional Information

No response

Environment

  • OS: Linux
  • Sage Version: 10.5.β9

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@user202729
Copy link
Contributor Author

user202729 commented Nov 18, 2024

        This non-uniqueness problem can in principle be solved by
        using *Conway polynomials*; see for example
        :wikipedia:`Conway_polynomial_(finite_fields)`. These have
        the drawback that computing them takes a long time.  Therefore
        Sage implements a variant called *pseudo-Conway polynomials*,
        which are easier to compute but do not determine an algebraic
        closure up to unique isomorphism.

        The output of this method is cached, so that within the same
        Sage session, calling it multiple times will return the same
        algebraic closure (i.e. the same Sage object).  Despite this,
        the non-uniqueness of the current implementation means that
        coercion and pickling cannot work as one might expect.  See
        below for an example.

Maybe that's why? Still, is it desirable to disallow copying?


Okay maybe that's not why, but there's this

sage: from sage.rings.algebraic_closure_finite_field import AlgebraicClosureFiniteField_pseudo_conway
sage: AlgebraicClosureFiniteField_pseudo_conway.__new__(AlgebraicClosureFiniteField_pseudo_conway)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 AlgebraicClosureFiniteField_pseudo_conway.__new__(AlgebraicClosureFiniteField_pseudo_conway)
TypeError: sage.misc.fast_methods.WithEqualityById.__new__(AlgebraicClosureFiniteField_pseudo_conway) is not safe, use AlgebraicClosureFiniteField_pseudo_conway.__new__()

On the other hand, strangely enough, pickling and unpickling the field works perfectly fine?

@user202729 user202729 linked a pull request Nov 18, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant