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

base_ring of orders in relative number fields is wrong #4738

Open
ncalexan mannequin opened this issue Dec 7, 2008 · 11 comments
Open

base_ring of orders in relative number fields is wrong #4738

ncalexan mannequin opened this issue Dec 7, 2008 · 11 comments

Comments

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Dec 7, 2008

I think that the last ring should be the ring of integers of the relative number field.

sage: K = NumberField([x^2 + 2, x^2 + 3], 'a')
sage: K.base_ring()
Number Field in a1 with defining polynomial x^2 + 3
sage: K.maximal_order()
Relative Order in Number Field in a0 with defining polynomial x^2 + 2 over its base field
sage: K.maximal_order().base_ring()
Integer Ring

CC: @williamstein

Component: number fields

Keywords: base ring relative number field order

Stopgaps: todo

Author: Alex Ghitza

Branch/Commit: u/AlexGhitza/ticket/4738 @ 2b45932

Issue created by migration from https://trac.sagemath.org/ticket/4738

@ncalexan ncalexan mannequin added this to the sage-5.11 milestone Dec 7, 2008
@ncalexan ncalexan mannequin added c: number theory labels Dec 7, 2008
@ncalexan ncalexan mannequin assigned williamstein Dec 7, 2008
@ncalexan
Copy link
Mannequin Author

ncalexan mannequin commented Dec 7, 2008

comment:1

Sorry, the ring of integesr of the base field of the relative number field.

@ncalexan
Copy link
Mannequin Author

ncalexan mannequin commented Dec 7, 2008

comment:2

While trying to fix this, I discovered that finding orders in relative number fields is ridiculously slow. I think pari probably will help here, either but computing it directly or by computing a basis for the absolute order and then constructing a basis for the relative order from it.

sage: K.<a,b> = NumberField([x^4 + 1, x^4 - 3])
sage: K.base_field().maximal_order()
Maximal Order in Number Field in b with defining polynomial x^4 - 3
sage: K.absolute_field('c').maximal_order()
Maximal Order in Number Field in c with defining polynomial x^16 - 8*x^12 + 432*x^8 + 640*x^4 + 256
sage: K.absolute_field('c').maximal_order().basis()
[3/512*c^14 + 3/352*c^12 + 3/128*c^10 + 3/704*c^8 + 1/32*c^6 + 15/176*c^4 + 1/44, 7/1024*c^15 + 1/512*c^14 + 3/704*c^13 + 1/256*c^12 + 3/256*c^11 + 1/128*c^10 + 3/1408*c^9 + 3/64*c^8 + 1/64*c^7 + 1/32*c^6 + 15/352*c^5 + 1/16*c^4 + 1/88*c, 35/5632*c^14 + 3/256*c^12 + 7/704*c^10 + 3/64*c^8 + 1/88*c^6 + 1/16*c^4 + 1/88*c^2, 79/11264*c^15 + 3/512*c^14 + 7/512*c^13 + 1/128*c^12 + 7/1408*c^11 + 1/128*c^10 + 3/128*c^9 + 1/32*c^8 + 1/176*c^7 + 1/32*c^6 + 1/32*c^5 + 1/176*c^3, 1/128*c^12 + 1/32*c^8 + 1/8*c^4, 1/256*c^15 + 3/256*c^13 + 1/64*c^9 + 1/16*c^5, 1/256*c^14 + 1/64*c^10 + 1/16*c^6, 1/512*c^15 + 1/128*c^13 + 1/128*c^11 + 1/32*c^7, 1/16*c^8, 1/256*c^15 + 1/32*c^9, 1/32*c^10, 1/256*c^15 + 1/128*c^13 + 1/64*c^11, 1/64*c^12, 1/64*c^13, 1/128*c^14, 1/128*c^15]
sage: K.maximal_order()
  C-c C-c---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)

/Users/ncalexan/.sage/temp/pv139196.reshsg.uci.edu/47346/_Users_ncalexan__sage_init_sage_0.py in <module>()
----> 1 
      2 
      3 
      4 
      5 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in maximal_order(self)
   4894         O = K.maximal_order()
   4895         B = [from_K(z) for z in O.basis()]
-> 4896         OK = self.order(B, check_is_integral=False, check_rank=False)
   4897         self.__maximal_order = OK
   4898         return OK

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.pyc in order(self, *gens, **kwds)
   5630             gens = gens[0]
   5631         gens = [self(x) for x in gens]
-> 5632         return order.relative_order_from_ring_generators(gens, **kwds)
   5633         
   5634 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc in relative_order_from_ring_generators(gens, check_is_integral, check_rank, is_maximal, allow_subfield)
   1640     module_gens = [to_Kabs(a) for a in gens]
   1641     n = [a.absolute_minpoly().degree() for a in gens]
-> 1642     absolute_order_module_gens = monomials(module_gens, n)
   1643 
   1644     abs_order =  absolute_order_from_module_generators(absolute_order_module_gens,

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     15         nn = list(n)
     16         del nn[i]
---> 17         v = monomials(w, nn)
     18         k = len(v)
     19         for _ in range(n[i]-1):

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in monomials(v, n)
     52     v = Sequence(v)
     53     R = v.universe()
---> 54     return _monomials(v, R, n, 0)
     55 
     56 

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/rings/monomials.pyc in _monomials(gens, R, n, i)
     19         for _ in range(n[i]-1):
     20             for j in range(k):
---> 21                 v.append(v[j]*z)
     22             z *= gens[i]
     23         return v

/Users/ncalexan/sage-3.2.1.alpha1/local/lib/python2.5/site-packages/sage/interfaces/get_sigs.pyc in my_sigint(x, n)
      7 
      8 def my_sigint(x, n):
----> 9     raise KeyboardInterrupt
     10 
     11 def my_sigfpe(x, n):

KeyboardInterrupt:

@ncalexan ncalexan mannequin changed the title base_ring of orders in relative number fields is wrong base_ring of orders in relative number fields is wrong and finding maximal_orders of relative number fields is very slow Dec 7, 2008
@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Apr 21, 2009

comment:3

The problem of the slowness of computing relative maximal orders is solved
by the patch in #5842. A doctest is included at line 532 of the patched
number_field_rel.py

@sagetrac-fwclarke sagetrac-fwclarke mannequin changed the title base_ring of orders in relative number fields is wrong and finding maximal_orders of relative number fields is very slow base_ring of orders in relative number fields is wrong Apr 21, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title base_ring of orders in relative number fields is wrong base_ring of orders in relative number fields is wrong (fix at #5842) Apr 21, 2009
@loefflerd loefflerd mannequin assigned loefflerd and unassigned williamstein Jul 21, 2009
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@aghitza
Copy link

aghitza commented Apr 18, 2014

Branch: u/AlexGhitza/ticket/4738

@aghitza
Copy link

aghitza commented Apr 18, 2014

Author: Alex Ghitza

@aghitza aghitza changed the title base_ring of orders in relative number fields is wrong (fix at #5842) base_ring of orders in relative number fields is wrong Apr 18, 2014
@pjbruin
Copy link
Contributor

pjbruin commented Apr 18, 2014

Commit: 2b45932

@pjbruin
Copy link
Contributor

pjbruin commented Apr 18, 2014

comment:11

Do we really want the maximal order of the base field? I would say the base ring should be the intersection of the relative order with the base field. In the following example, the order R in L does not contain the maximal order of K:

sage: K.<s> = QuadraticField(5)
sage: O = K.order(s)  # of index 2 in the maximal order of K
sage: L.<t> = K.extension(x^2 + 1)
sage: R = L.order((s, t))
sage: a = (1 + s)/2
sage: a.is_integral()
True
sage: L(a) in R  # check that R does not contain the maximal order of K
False

Note the L(a) in the last line; this is because there is also the following bug:

sage: s in R
False  # clearly wrong because R = ZZ[s, t] as a subring of L

New commits:

987d39ffix base ring of order in relative number field
2b45932fix base ring of orders in relative number fields

@pjbruin
Copy link
Contributor

pjbruin commented Apr 18, 2014

comment:12

Note the L(a) in the last line; this is because there is also the following bug:

sage: s in R
False  # clearly wrong because R = ZZ[s, t] as a subring of L

This would probably be fixed by implementing a coercion morphism from the base order to the relative order. However, we currently cannot construct this morphism at all:

sage: O.hom((R(s),))
...
TypeError: images do not define a valid homomorphism

The error probably arises because Order._is_valid_homomorphism_() is not implemented.

@pjbruin
Copy link
Contributor

pjbruin commented May 3, 2014

comment:13

The base ring should be either Z or the order intersected with the base field (which is in general not the maximal order of the base field). We have to decide which is better.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin removed this from the sage-6.2 milestone May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin added this to the sage-6.3 milestone May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Aug 19, 2015

Stopgaps: todo

@jdemeyer
Copy link

jdemeyer commented Mar 1, 2017

comment:17

Doctest failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants