Opened 5 years ago

Last modified 4 years ago

#23418 closed enhancement

put number fields in Fields().Infinite() — at Version 9

Reported by: chapoton Owned by:
Priority: minor Milestone: sage-8.2
Component: number fields Keywords:
Cc: nthiery, tscrim Merged in:
Authors: Frédéric Chapoton, Vincent Delecroix Reviewers:
Report Upstream: N/A Work issues:
Branch: u/vdelecroix/23418 (Commits, GitHub, GitLab) Commit: d2bf048cc8da72b16e8c020d8c5fb6aa3b9ee923
Dependencies: Stopgaps:

Status badges

Description (last modified by vdelecroix)

and the same for QQ of course

follow up at #24432

Change History (9)

comment:1 Changed 5 years ago by chapoton

  • Branch set to u/chapoton/23418
  • Commit set to 2f98551bf0aa8fc99f98cf2cdecf2fdaf584e5df

New commits:

2f98551trac 23418 fixing some doctests in rings and category folders

comment:2 Changed 5 years ago by git

  • Commit changed from 2f98551bf0aa8fc99f98cf2cdecf2fdaf584e5df to a06ebbcba1804cbc7bbf0f4cb347b1a022c27335

Branch pushed to git repo; I updated commit sha1. New commits:

a06ebbctrac 23418 correct more doctests

comment:3 Changed 5 years ago by chapoton

This triggers some problem here:

sage -t --long src/sage/structure/parent.pyx  # 6 doctests failed

comment:4 Changed 5 years ago by chapoton

  • Cc nthiery added

It seems that the morphisms from Sets take over the morphisms from Rings..

comment:5 Changed 5 years ago by tscrim

Failures are related to this:

sage: x = QQ['x'].0
sage: t = abs(ZZ.random_element(10^6))
sage: K = NumberField(x^2 + 2*3*7*11, "a"+str(t))
sage: a = K.gen()

sage: Hom(K, a.matrix().parent())
Set of Morphisms from Number Field in a791947 with defining polynomial x^2 + 462 to Full MatrixSpace of 2 by 2 dense matrices over Rational Field in Category of infinite rings
<class 'sage.categories.homset.Homset_with_category'>

compared to vanilla Sage:

sage: Hom(K, a.matrix().parent())
Set of Homomorphisms from Number Field in a395598 with defining polynomial x^2 + 462 to Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: type(Hom(K, a.matrix().parent()))
<class 'sage.rings.homset.RingHomset_generic_with_category'>

This differences comes from the fact that the category becomes a join category (in the branch) because that is the meet category computed by Hom:

sage: K.category()._meet_(a.matrix().parent().category())
Category of infinite rings
sage: type(_)
<class 'sage.categories.category.JoinCategory_with_category'>

versus vanilla:

sage: K.category()._meet_(a.matrix().parent().category())
Category of rings
sage: type(_)
<class 'sage.categories.rings.Rings_with_category'>

Now, K is not a subclass of the meet category's parent_class, which causes the Cat.parent_class._Hom_ method to now raise an error:

sage: Cat = K.category()._meet_(a.matrix().parent().category())
sage: Cat.parent_class
<class 'sage.categories.category.JoinCategory.parent_class'>
sage: Cat.parent_class._Hom_(K, a.matrix().parent(), Cat)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-aa7f8d9cdf73> in <module>()
----> 1 Cat.parent_class._Hom_(K, a.matrix().parent(), Cat)
TypeError: unbound method _Hom_() must be called with JoinCategory.parent_class instance as first argument (got NumberField_quadratic_with_category instance instead)

versus vanilla

sage: Cat = K.category()._meet_(a.matrix().parent().category())
sage: Cat.parent_class
<class 'sage.categories.rings.Rings.parent_class'>
sage: Cat.parent_class._Hom_(K, a.matrix().parent(), Cat)
Set of Homomorphisms from Number Field in a395598 with defining polynomial x^2 + 462 to Full MatrixSpace of 2 by 2 dense matrices over Rational Field
Last edited 5 years ago by tscrim (previous) (diff)

comment:6 Changed 5 years ago by chapoton

  • Branch changed from u/chapoton/23418 to u/chapoton/23418_bare
  • Commit changed from a06ebbcba1804cbc7bbf0f4cb347b1a022c27335 to ba2ec5b2b3f1f5001541fcfeaea9597d4acc7866

New commits:

ba2ec5bMerge commit '2f98551bf0aa8fc99f98cf2cdecf2fdaf584e5df' in 8.1.b5

comment:7 Changed 5 years ago by git

  • Commit changed from ba2ec5b2b3f1f5001541fcfeaea9597d4acc7866 to 4e88b49d6818f5ef6abd61900a6e23024f576121

Branch pushed to git repo; I updated commit sha1. New commits:

4e88b49fix

comment:8 Changed 5 years ago by git

  • Commit changed from 4e88b49d6818f5ef6abd61900a6e23024f576121 to 6d3e53209220b9d5132a2eaa583e14306c3d92fd

Branch pushed to git repo; I updated commit sha1. New commits:

6d3e532trac 23418 fix

comment:9 Changed 5 years ago by vdelecroix

  • Authors changed from Frédéric Chapoton to Frédéric Chapoton, Vincent Delecroix
  • Branch changed from u/chapoton/23418_bare to u/vdelecroix/23418
  • Commit changed from 6d3e53209220b9d5132a2eaa583e14306c3d92fd to d2bf048cc8da72b16e8c020d8c5fb6aa3b9ee923
  • Description modified (diff)
  • Milestone changed from sage-8.1 to sage-8.2
  • Status changed from new to needs_review

New commits:

d2bf04823418: number fields are infinite
Note: See TracTickets for help on using tickets.