exporting patch:
# HG changeset patch
# User Julian Rüth <julian.rueth@gmail.com>
# Date 1307562725 7200
# Node ID e515debf2b340e3d58cb352452503702b39e4385
# Parent 3ff1fea4eb0e943ae478fcf59a159d34b059d8d3
Trac 9054: polynomial must be defined over the base field
diff r 3ff1fea4eb0e r e515debf2b34 sage/rings/function_field/function_field.py
a

b


125  125  sage: K.extension(y^5  x^3  3*x + x*y) 
126  126  Function field in y defined by y^5 + x*y  x^3  3*x 
127  127  
128   
129  128  A nonintegral defining polynomial:: 
130  129  
131  130  sage: K.<t> = FunctionField(QQ); R.<y> = K[] 
… 
… 

137  136  sage: K.extension(t*y^3 + (1/t)*y + t^3/(t+1)) 
138  137  Function field in y defined by t*y^3 + 1/t*y + t^3/(t + 1) 
139  138  """ 
 139  from sage.rings.polynomial.all import is_Polynomial 
140  140  if names is None: 
141  141  names = f.variable_name() 
 142  if not is_Polynomial(f): 
 143  raise TypeError, "polynomial must be a polynomial" 
 144  if f.parent().base_ring() is not self: 
 145  raise ValueError, "The polynomial must be defined over the base field" 
142  146  return FunctionField_polymod(f, names) 
143  147  
144  148  def order_with_basis(self, basis, check=True): 
… 
… 

288  292  We make another extension of a rational function field:: 
289  293  
290  294  sage: R2.<t> = FunctionField(QQ); S2.<w> = R2[] 
291   sage: L2.<w> = R.extension((4*w)^2  (t+1)^3  1) 
 295  sage: L2.<w> = R2.extension((4*w)^2  (t+1)^3  1) 
292  296  
293  297  We define a morphism, by givin the images of generators:: 
294  298  