# HG changeset patch
# User Maarten Derickx <m.derickx.student@gmail.com>
# Date 1316031695 7200
# Node ID 6f8e65667825ffd0345261f51cfa3dce2dc131cc
# Parent 153bb398098fc3436dd120f465b9533a52d9a3ff
#9054 fix jullians last comment
diff git a/sage/rings/function_field/function_field_ideal.py b/sage/rings/function_field/function_field_ideal.py
a

b


1  1  from sage.rings.ideal import Ideal_generic 
2   
 2  from sage.modules import free_module_element 
3  3  class FunctionFieldIdeal(Ideal_generic): 
4  4  """ 
5  5  A fractional ideal of a function field. 
… 
… 

228  228  sage: L.<y> = R.extension(y^2  x^3  1); M = L.equation_order() 
229  229  sage: sage.rings.function_field.function_field_ideal.ideal_with_gens_over_base(M, [x^3+1,y]) 
230  230  Ideal (x^3 + 1, y) of Order in Function field in y defined by y^2  x^3  1 
 231  
 232  TESTS:: 
 233  sage: K.<x> = FunctionField(QQ) 
 234  sage: O = K.maximal_order() 
 235  sage: I = O*x 
 236  sage: ~I 
 237  Ideal (1/x) of Maximal order in Rational function field in x over Rational Field 
 238  sage: ~I == O.ideal(1/x) 
 239  True 
 240  
231  241  """ 
232  242  K = R.fraction_field() 
233  243  V, from_V, to_V = K.vector_space() 
… 
… 

238  248  import function_field_order 
239  249  if isinstance(R, function_field_order.FunctionFieldOrder_rational): 
240  250  try: 
241   v = R._ring.ideal([x.element() for x in gens]).gens_reduced() 
 251  gens = free_module_element.vector(x.element() for x in gens) 
 252  d = gens.denominator() 
 253  gens *= d 
 254  v = R._ring.ideal(gens.list()).gens_reduced() 
242  255  assert len(v) == 1 
243   basis = [to_V(v[0])] 
 256  basis = [to_V(v[0]/d)] 
244  257  M = V.span_of_basis(basis, check=False, already_echelonized=True, base_ring=R) 
245  258  except Exception, msg: 
246  259  print msg # TODO for debugging 