I suspect this is just an oversight in the R.number_field() method --  
for instance, the following causes trouble:

sage: A.<x> = QQ[]

sage: R = A.quotient_ring(x^2+x+1)

sage: K = R.number_field()

sage: K
Number Field in xbar with defining polynomial x^2 + x + 1

sage: x.parent()
Univariate Polynomial Ring in x over Rational Field

sage: K(x)
xbar

sage: R(x)
xbar

sage: K(R(x))
------------------------------------------------------------------------ 
---
<type 'exceptions.TypeError'>             Traceback (most recent call  
last)

/Users/craigcitro/<ipython console> in <module>()

/sage/local/lib/python2.5/site-packages/sage/rings/number_field/ 
number_field.
in __call__(self, x)
   1033         elif isinstance(x,str):
   1034             return self._coerce_from_str(x)
-> 1035         return self._coerce_non_number_field_element_in(x)
   1036
   1037     def _coerce_from_str(self, x):

/sage/local/lib/python2.5/site-packages/sage/rings/number_field/ 
number_field.
in _coerce_non_number_field_element_in(self, x)
   1123         except (TypeError, AttributeError), msg:
   1124             pass
-> 1125         raise TypeError
   1126
   1127     def _coerce_impl(self, x):

<type 'exceptions.TypeError'>:

That is, if R is my PolynomialQuotientRing, and K is the associated  
number
field, I can't coerce from R to K! Even K(R(1)) fails. Maybe this one  
is just
me misunderstanding the coercion model, because you can pretty easily  
make it
work:

sage: H = Hom(R,K)

sage: H
Set of Homomorphisms from Univariate Quotient Polynomial Ring in xbar  
over
Rational Field with modulus x^2 + x + 1 to Number Field in xbar with  
defining
polynomial x^2 + x + 1

sage: K.0
xbar

sage: H(([K.0]))
Ring morphism:
  From: Univariate Quotient Polynomial Ring in xbar over Rational  
Field with
  modulus x^2 + x + 1
  To:   Number Field in xbar with defining polynomial x^2 + x + 1
  Defn: xbar |--> xbar

sage: f = H(([K.0]))

sage: f(R(1))
1

sage: f(R(x))
xbar


However, I haven't played with what David Roe was pointing out to see  
how that goes; presumably that problem is still present.

-cc

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to