# Ticket #9054: trac_9054-can_this_really_be_the_last.2.patch

File trac_9054-can_this_really_be_the_last.2.patch, 2.9 KB (added by saraedum, 10 years ago)

last fixes for function fields

• ## sage/rings/function_field/function_field_order.py

```# HG changeset patch
# User Maarten Derickx <m.derickx.student@gmail.com>
# Date 1320712272 28800
# Node ID ea60614cb5d0a712cdaac4e2a5b1a65fba50db7a
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 #***************************************************************************** from sage.rings.ring import IntegralDomain, PrincipalIdealDomain from sage.rings.ideal import is_Ideal class FunctionFieldOrder(IntegralDomain): """ INPUT: - ``gens`` -- a list of generators - ``gens`` -- a list of generators or an ideal in a ring which coerces to this order. EXAMPLES:: A fractional ideal of a nontrivial extension:: sage: K. = FunctionField(GF(7)); R. = K[] sage: O = K.maximal_order() sage: I = O.ideal(x^2-4) sage: L. = K.extension(y^2 - x^3 - 1) sage: O = L.equation_order() sage: O.ideal(1/y) sage: S = L.equation_order() sage: S.ideal(1/y) Ideal (1, (6/(x^3 + 1))*y) of Order in Function field in y defined by y^2 + 6*x^3 + 6 sage: I2 = S.ideal(x^2-4); I2 Ideal (x^2 + 3, (x^2 + 3)*y) of Order in Function field in y defined by y^2 + 6*x^3 + 6 sage: I2 == S.ideal(I) True """ if len(gens) == 1: gens = gens[0] if not isinstance(gens, (list, tuple)): gens = [gens] if is_Ideal(gens): gens = gens.gens() else: gens = [gens] from function_field_ideal import ideal_with_gens return ideal_with_gens(self, gens) True sage: O.ideal(x^3+1,x^3+6) Ideal (1) of Maximal order in Rational function field in x over Rational Field sage: O.ideal((x^2+1)*(x^3+1),(x^3+6)*(x^2+1)) sage: I = O.ideal((x^2+1)*(x^3+1),(x^3+6)*(x^2+1)); I Ideal (x^2 + 1) of Maximal order in Rational function field in x over Rational Field sage: O.ideal(I) Ideal (x^2 + 1) of Maximal order in Rational function field in x over Rational Field """ if len(gens) == 1: gens = gens[0] if not isinstance(gens, (list, tuple)): gens = (gens,) if is_Ideal(gens): gens = gens.gens() else: gens = (gens,) from function_field_ideal import ideal_with_gens return ideal_with_gens(self, gens)