Skip to content

Commit

Permalink
adjust doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyx4 committed Sep 18, 2024
1 parent 8783440 commit fe7ae08
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ with ideals in non-maximal orders.
sage: K.<a> = NumberField(x^3 + 2)
sage: R = K.order(3*a)
sage: R.ideal(5)
doctest:warning ... FutureWarning: ...
Ideal (5, 15*a, 45*a^2) of Order generated by 3*a in Number Field in a with defining polynomial x^3 + 2
sage: R.ideal(5).factor()
Traceback (most recent call last):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/modular/dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,8 @@ class DirichletGroupFactory(UniqueFactory):
::
sage: r4 = CyclotomicField(4).ring_of_integers()
sage: K = CyclotomicField(4)
sage: r4 = K.ring_of_integers()
sage: G = DirichletGroup(60, r4)
sage: G.gens()
(Dirichlet character modulo 60 of conductor 4
Expand All @@ -2393,8 +2394,7 @@ class DirichletGroupFactory(UniqueFactory):
zeta4
sage: parent(val)
Gaussian Integers generated by zeta4 in Cyclotomic Field of order 4 and degree 2
sage: r4_29_0 = r4.residue_field(r4.ideal(29).factor()[0][0]); r4_29_0(val)
doctest:warning ... DeprecationWarning: ...
sage: r4_29_0 = r4.residue_field(K(29).factor()[0][0]); r4_29_0(val)
17
sage: r4_29_0(val) * GF(29)(3)
22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,7 @@ cdef class OrderElement_quadratic(NumberFieldElement_quadratic):
-13
sage: w.inverse_mod(13).parent() == OE
True
sage: w.inverse_mod(2*OE)
sage: w.inverse_mod(2)
Traceback (most recent call last):
...
ZeroDivisionError: w is not invertible modulo Fractional ideal (2)
Expand Down
22 changes: 7 additions & 15 deletions src/sage/rings/number_field/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,10 @@ def ideal(self, *args, **kwds):
sage: x = polygen(ZZ, 'x')
sage: K.<a> = NumberField(x^2 + 7)
sage: R = K.maximal_order()
sage: R.ideal(2/3 + 7*a, a)
Traceback (most recent call last):
...
ValueError: ideal must be integral;
use fractional_ideal to create a non-integral ideal.
sage: R.ideal(7*a, 77 + 28*a)
Fractional ideal (7)
sage: R.ideal([7*a, 77 + 28*a])
Ideal (7/2*a + 7/2, 7*a) of Maximal Order generated by 1/2*a + 1/2 in Number Field in a with defining polynomial x^2 + 7
sage: R = K.order(4*a)
sage: R.ideal(8)
doctest:warning ... FutureWarning: ...
Ideal (8, 32*a) of Order of conductor 8 generated by 4*a
in Number Field in a with defining polynomial x^2 + 7
Expand All @@ -532,13 +526,12 @@ def ideal(self, *args, **kwds):
sage: R = EquationOrder(x^2 + 2, 'a'); R
Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 2
sage: (3,15)*R
doctest:warning ... DeprecationWarning: ...
Fractional ideal (3)
Ideal (3, 3*a) of Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 2
The zero ideal is handled properly::
sage: R.ideal(0)
Ideal (0) of Number Field in a with defining polynomial x^2 + 2
Ideal (0) of Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 2
"""
# these keyword arguments are ignored since there used to be optional
# arguments with these names for controlling deprecated/future behavior;
Expand Down Expand Up @@ -580,10 +573,9 @@ def __mul__(self, right):
sage: Ok = k.maximal_order(); Ok
Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 5077
sage: Ok * (11, a + 7)
doctest:warning ... DeprecationWarning: ...
Fractional ideal (11, a + 7)
Ideal (8*a + 1, 11*a) of Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 5077
sage: (11, a + 7) * Ok
Fractional ideal (11, a + 7)
Ideal (8*a + 1, 11*a) of Maximal Order generated by a in Number Field in a with defining polynomial x^2 + 5077
"""
return self.ideal(right)

Expand All @@ -603,7 +595,7 @@ def __rmul__(self, left):
sage: (6, 1/2*a + 11/2)*Ok # random output
Fractional ideal (6, 1/2*a + 11/2)
sage: 17*Ok
Fractional ideal (17)
Ideal (17/2*a + 17/2, 17*a) of Maximal Order generated by 1/2*a + 1/2 in Number Field in a with defining polynomial x^2 + 431
"""
return self.ideal(left)

Expand Down
10 changes: 0 additions & 10 deletions src/sage/rings/number_field/order_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
ideals of non-maximal orders (compared to the maximal case).
This should hopefully change in the future.
TESTS:
This module is currently experimental::
sage: import sage.rings.number_field.order_ideal
doctest:warning ...
EXAMPLES::
sage: O = QuadraticField(-1).order(5*i)
Expand Down Expand Up @@ -75,9 +68,6 @@
from sage.rings.polynomial.polynomial_ring import polygens
from sage.rings.ideal import Ideal_generic

from sage.misc.superseded import experimental_warning
experimental_warning(34198, 'Ideals of non-maximal orders are an experimental feature. Be wary of bugs.')

import sage.rings.number_field.order

#TODO I*u works when u lies in I.ring().number_field(), but u*I doesn't
Expand Down

0 comments on commit fe7ae08

Please sign in to comment.