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

[fixed by #5508] coercion to orders in relative number fields is not implemented #5214

Closed
ncalexan mannequin opened this issue Feb 9, 2009 · 5 comments
Closed

[fixed by #5508] coercion to orders in relative number fields is not implemented #5214

ncalexan mannequin opened this issue Feb 9, 2009 · 5 comments

Comments

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Feb 9, 2009

sage: t = OK.basis()[0]
sage: x = ZZ['x'].0
sage: K.<a,b> = NumberField([x^2 + 1, x^2 - 3])
sage: OK = K.maximal_order(); OK.basis()                                                                                          
[1, 1/2*a - 1/2*b, -1/2*b*a + 1/2, a]
sage: OK(a)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (363, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1152, 0))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ncalexan/.sage/temp/sage.math.washington.edu/21534/_home_ncalexan__sage_init_sage_0.py in <module>()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc\
 in __call__(self, x)
   1192         if x.parent() is not self._K:
   1193             x = self._K(x)
-> 1194         x = self._absolute_order(x) # will test membership
   1195         return OrderElement_relative(self, x)
   1196

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc\
 in __call__(self, x)
    900             return x
    901         if not is_Element(x) or x.parent() is not self._K:
--> 902             x = self._K(x)
    903         V, _, embedding = self._K.vector_space()
    904         if not embedding(x) in self._module_rep:

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/parent.so in sage.\
structure.parent.Parent.__call__ (sage/structure/parent.c:3653)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/coerce_maps.so in \
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:2793)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/coerce_maps.so in \
sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:2700)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/number_fi\
eld.pyc in _element_constructor_(self, x)
    829                     return self._element_class(self, x)
    830                 x = L(x)
--> 831             return self._coerce_from_other_number_field(x)
    832         elif isinstance(x,str):
    833             return self._coerce_from_str(x)

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/number_fi\
eld.pyc in _coerce_from_other_number_field(self, x)
   3560             return self._element_class(self, f[0])
   3561         # todo: more general coercion if embedding have been asserted
-> 3562         raise TypeError, "Cannot coerce element into this number field"
   3563
   3564     def _coerce_non_number_field_element_in(self, x):

TypeError: Cannot coerce element into this number field
OK(b)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (363, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1152, 0))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ncalexan/.sage/temp/sage.math.washington.edu/21534/_home_ncalexan__sage_init_sage_0.py in <module>()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc\
 in __call__(self, x)
   1192         if x.parent() is not self._K:
   1193             x = self._K(x)
-> 1194         x = self._absolute_order(x) # will test membership
   1195         return OrderElement_relative(self, x)
   1196

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc\
 in __call__(self, x)
    900             return x
    901         if not is_Element(x) or x.parent() is not self._K:
--> 902             x = self._K(x)
    903         V, _, embedding = self._K.vector_space()
    904         if not embedding(x) in self._module_rep:

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/parent.so in sage.\
structure.parent.Parent.__call__ (sage/structure/parent.c:3653)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/coerce_maps.so in \
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:2793)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/structure/coerce_maps.so in \
sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:2700)()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/number_fi\
eld.pyc in _element_constructor_(self, x)
    829                     return self._element_class(self, x)
    830                 x = L(x)
--> 831             return self._coerce_from_other_number_field(x)
    832         elif isinstance(x,str):
    833             return self._coerce_from_str(x)

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/number_fi\
eld.pyc in _coerce_from_other_number_field(self, x)
/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/number_fi\
eld.pyc in _coerce_from_other_number_field(self, x)
   3560             return self._element_class(self, f[0])
   3561         # todo: more general coercion if embedding have been asserted
-> 3562         raise TypeError, "Cannot coerce element into this number field"
   3563
   3564     def _coerce_non_number_field_element_in(self, x):

TypeError: Cannot coerce element into this number field
sage: OK.basis()[3].list()
[0, 1]
sage: OK(OK.basis()[3].list())
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/ncalexan/.sage/temp/sage.math.washington.edu/21534/_home_ncalexan__sage_init_sage_0.py in <module>()

/scratch/ncalexan/sage-3.3.alpha5-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/rings/number_field/order.pyc\
 in __call__(self, x)
   1190         Coerce an element into this relative order.
   1191         """                                                                                                               
-> 1192         if x.parent() is not self._K:                                                                                     
   1193             x = self._K(x)                                                                                                
   1194         x = self._absolute_order(x) # will test membership                                                                
                                                                                                                                  
AttributeError: 'list' object has no attribute 'parent'                                      

CC: @robertwb

Component: number theory

Keywords: relative order number field coercion

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

@ncalexan ncalexan mannequin added this to the sage-3.4 milestone Feb 9, 2009
@ncalexan ncalexan mannequin added c: number theory labels Feb 9, 2009
@ncalexan ncalexan mannequin assigned williamstein Feb 9, 2009
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Feb 9, 2009

comment:1

3.4 is mostly about the ReST patches. Once those are in we will likely cut 3.4 as a release and then quickly open 3.4.1 to merge fixes on top of the ReST code.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.4, sage-3.4.1 Feb 9, 2009
@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Mar 13, 2009

comment:2

The problem is solved by changes to __call__ for the class RelativeOrder in sage/rings/number_theory/order.py to be found in #5508.

@sagetrac-fwclarke sagetrac-fwclarke mannequin changed the title coercion to orders in relative number fields is not implemented [fixed subject to review of #5508] coercion to orders in relative number fields is not implemented Mar 13, 2009
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 25, 2009

comment:3

To close this we would need a doctest.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title [fixed subject to review of #5508] coercion to orders in relative number fields is not implemented [fixed by #5508] coercion to orders in relative number fields is not implemented Mar 25, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.4.2, sage-3.4.1 Mar 25, 2009
@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Mar 26, 2009

comment:5

Replying to @sagetrac-mabshoff:

To close this we would need a doctest.

See lines 1194 to 1199 of sage/rings/number_field/order.py as patched by
#5508:

            sage: K.<a, b> = NumberField([x^2 + 2, x^2 + 1000*x + 1]) 
            sage: OK = K.ring_of_integers()
            sage: OK(a)
            sage: a
            sage: OK([3, 4])
            4*a + 3

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 26, 2009

comment:6

Fixed in Sage 3.4.1.alpha0 via #5508. Thanks Francis :)

Cheers,

Michael

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

1 participant