# HG changeset patch
# User Maarten Derickx <m.derickx.student@gmail.com>
# Date 1320712272 28800
# Node ID ea60614cb5d0a712cdaac4e2a5b1a65fba50db7a
# Parent f14a46a3f3d5e30ad14eb2d5d87754edd67e5ec6
Trac 9054: last fixes for function fields
diff git a/sage/rings/function_field/function_field_order.py b/sage/rings/function_field/function_field_order.py
a

b


42  42  #***************************************************************************** 
43  43  
44  44  from sage.rings.ring import IntegralDomain, PrincipalIdealDomain 
 45  from sage.rings.ideal import is_Ideal 
45  46  
46  47  class FunctionFieldOrder(IntegralDomain): 
47  48  """ 
… 
… 

174  175  
175  176  INPUT: 
176  177  
177    ``gens``  a list of generators 
 178   ``gens``  a list of generators or an ideal in a ring which 
 179  coerces to this order. 
178  180  
179  181  EXAMPLES:: 
180  182  
… 
… 

188  190  A fractional ideal of a nontrivial extension:: 
189  191  
190  192  sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] 
 193  sage: O = K.maximal_order() 
 194  sage: I = O.ideal(x^24) 
191  195  sage: L.<y> = K.extension(y^2  x^3  1) 
192   sage: O = L.equation_order() 
193   sage: O.ideal(1/y) 
 196  sage: S = L.equation_order() 
 197  sage: S.ideal(1/y) 
194  198  Ideal (1, (6/(x^3 + 1))*y) of Order in Function field in y defined by y^2 + 6*x^3 + 6 
 199  sage: I2 = S.ideal(x^24); I2 
 200  Ideal (x^2 + 3, (x^2 + 3)*y) of Order in Function field in y defined by y^2 + 6*x^3 + 6 
 201  sage: I2 == S.ideal(I) 
 202  True 
195  203  """ 
196  204  if len(gens) == 1: 
197  205  gens = gens[0] 
198  206  if not isinstance(gens, (list, tuple)): 
199   gens = [gens] 
 207  if is_Ideal(gens): 
 208  gens = gens.gens() 
 209  else: 
 210  gens = [gens] 
200  211  from function_field_ideal import ideal_with_gens 
201  212  return ideal_with_gens(self, gens) 
202  213  
… 
… 

403  414  True 
404  415  sage: O.ideal(x^3+1,x^3+6) 
405  416  Ideal (1) of Maximal order in Rational function field in x over Rational Field 
406   sage: O.ideal((x^2+1)*(x^3+1),(x^3+6)*(x^2+1)) 
 417  sage: I = O.ideal((x^2+1)*(x^3+1),(x^3+6)*(x^2+1)); I 
 418  Ideal (x^2 + 1) of Maximal order in Rational function field in x over Rational Field 
 419  sage: O.ideal(I) 
407  420  Ideal (x^2 + 1) of Maximal order in Rational function field in x over Rational Field 
408  421  """ 
409  422  if len(gens) == 1: 
410  423  gens = gens[0] 
411  424  if not isinstance(gens, (list, tuple)): 
412   gens = (gens,) 
 425  if is_Ideal(gens): 
 426  gens = gens.gens() 
 427  else: 
 428  gens = (gens,) 
413  429  from function_field_ideal import ideal_with_gens 
414  430  return ideal_with_gens(self, gens) 
415  431  