Sage 10.0

83 views
Skip to first unread message

Justin C. Walker

unread,
Aug 13, 2026, 11:42:10 PM (5 days ago) Aug 13
to SAGE Support
I have upgraded to macOS 26, and have installed sage 10.9.
I ran the same code on sage 10.9, and, on a slightly, longer-in-the-tooth, version of macOS (10.13.6)., using sage 9.7.

I found that, creating an ideal in the maximal order of a number field, asking for its factorization works on the older macOS and sage, but fails on 19.9. In the newer version, there is no “factor” method attached to a prime in a number field.

Am I missing something? Did things change that much between the major releases?

Help/pointers will, as always, be appreciated.

Thanks,

Justin

Dima Pasechnik

unread,
Aug 15, 2026, 1:55:06 AM (4 days ago) Aug 15
to sage-s...@googlegroups.com
please provide the example code to show this discrepancy.
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/D4249A5E-30D7-4C97-A4F0-80FB826F9BAA%40mac.com.

Justin C. Walker

unread,
Aug 15, 2026, 7:05:27 PM (4 days ago) Aug 15
to SAGE Support
Here’s a snippet that shows the problem . I’m not at home, so I can’t be sure of this. No sage variants here :-}

F = x^3-37
p = 29
K..<a> = NumberField(f)
OK = K.maximal_order()
P = p*OK
P.factor()

Justin
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAAWYfq1%3DvR%2B7mKK_Xtf9MeJWgcERo%3DBAAtbpMr5jD8x6Ke6j3g%40mail.gmail.com.

Dima Pasechnik

unread,
Aug 16, 2026, 3:28:24 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
On Sat, Aug 15, 2026 at 6:05 PM 'Justin C. Walker' via sage-support
<sage-s...@googlegroups.com> wrote:
>
> Here’s a snippet that shows the problem . I’m not at home, so I can’t be sure of this. No sage variants here :-}
>
> F = x^3-37
> p = 29
> K..<a> = NumberField(f)
K.<a> = NumberField(F) # typos

> OK = K.maximal_order()
> P = p*OK
> P.factor()

indeed this does not work with the current 10.10 beta. I don't have
old versions of Sage to check, and cocalc doesn't seem to provide them
any more.


>
> Justin
>
> > On Aug 14, 2026, at 10:54 PM, Dima Pasechnik <dim...@gmail.com> wrote:
> >
> > please provide the example code to show this discrepancy.
> >
> > On Thu, Aug 13, 2026 at 10:42 PM 'Justin C. Walker' via sage-support
> > <sage-s...@googlegroups.com> wrote:
> >>
> >> I have upgraded to macOS 26, and have installed sage 10.9.
> >> I ran the same code on sage 10.9, and, on a slightly, longer-in-the-tooth, version of macOS (10.13.6)., using sage 9.7.
> >>
> >> I found that, creating an ideal in the maximal order of a number field, asking for its factorization works on the older macOS and sage, but fails on 19.9. In the newer version, there is no “factor” method attached to a prime in a number field.
> >>
> >> Am I missing something? Did things change that much between the major releases?
> >>
> >> Help/pointers will, as always, be appreciated.
> >>
> >> Thanks,
> >>
> >> Justin
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "sage-support" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> >> To view this discussion visit https://groups.google.com/d/msgid/sage-support/D4249A5E-30D7-4C97-A4F0-80FB826F9BAA%40mac.com.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "sage-support" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> > To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAAWYfq1%3DvR%2B7mKK_Xtf9MeJWgcERo%3DBAAtbpMr5jD8x6Ke6j3g%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/0329CAAF-A896-4958-B4A5-722E2114A7C3%40mac.com.

David Joyner

unread,
Aug 16, 2026, 3:42:46 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
On Sun, Aug 16, 2026 at 3:28 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Sat, Aug 15, 2026 at 6:05 PM 'Justin C. Walker' via sage-support
> <sage-s...@googlegroups.com> wrote:
> >
> > Here’s a snippet that shows the problem . I’m not at home, so I can’t be sure of this. No sage variants here :-}
> >
> > F = x^3-37
> > p = 29
> > K..<a> = NumberField(f)
> K.<a> = NumberField(F) # typos
>
> > OK = K.maximal_order()
> > P = p*OK
> > P.factor()
>
> indeed this does not work with the current 10.10 beta. I don't have
> old versions of Sage to check, and cocalc doesn't seem to provide them

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.4, Release Date: 2024-07-19 │
│ Using Python 3.12.4. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: F = x^3-37
....: p = 29
....: K.<a> = NumberField(F) # typos
....: OK = K.maximal_order()
....: P = p*OK
....: P.factor()
(Fractional ideal (-a^2 - 2*a - 4)) * (Fractional ideal (a - 2))
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAAWYfq2Zk3ESn2-2L%2BPEnmkpCJ6ok9q_2-8EsjbSx_kbf2BO4Q%40mail.gmail.com.

Dima Pasechnik

unread,
Aug 16, 2026, 3:51:11 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
Hi David,
can you tell us types of OK and P in Sage 10.4 ?

Maybe P gets its type wrong now?

Dima
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAEQuuAXFP9SuSzLiLOA7mLfKVc656qdty-GcjoH9CCoB%3DzgO5w%40mail.gmail.com.

David Joyner

unread,
Aug 16, 2026, 3:55:43 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
On Sun, Aug 16, 2026 at 3:51 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> Hi David,
> can you tell us types of OK and P in Sage 10.4 ?
>

sage: OK.parent()
<class 'sage.rings.number_field.order.Order_absolute_with_category'>
sage: P.parent()
Monoid of ideals of Number Field in a with defining polynomial x^3 - 37
sage: type(P)
<class 'sage.rings.number_field.number_field_ideal.NumberFieldFractionalIdeal'>
sage: type(OK)
<class 'sage.rings.number_field.order.Order_absolute_with_category'>
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAAWYfq1NvSKeRGFqtd2tdQisZeDnfdDWTU6z1AaPPML0YYvDmw%40mail.gmail.com.

Dima Pasechnik

unread,
Aug 16, 2026, 4:03:22 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
types are the same, parents are a bit different:

sage: P.parent()
Monoid of ideals of Maximal Order generated by [1/3*a^2 + 1/3*a + 1/3,
a] in Number Field in a with defining polynomial x^3 - 37
sage: OK.parent()
<class 'sage.rings.number_field.order.Order_absolute_with_category'>
<class 'sage.rings.number_field.order_ideal.NumberFieldOrderIdeal_generic'>
sage: type(OK)
<class 'sage.rings.number_field.order.Order_absolute_with_category'>
sage:

What is the output here:

sage: P.factor??

(here ?? is what we use to print the source code).

Why there was no doctest for these cases of factor()? Maybe it's an
off-label use?
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAEQuuAUx512JLh4ysY7WNzNraFk-WzOxa13jDeqbcf3zeGt9qw%40mail.gmail.com.

David Joyner

unread,
Aug 16, 2026, 4:05:26 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
On Sun, Aug 16, 2026 at 4:03 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> types are the same, parents are a bit different:
>
> sage: P.parent()
> Monoid of ideals of Maximal Order generated by [1/3*a^2 + 1/3*a + 1/3,
> a] in Number Field in a with defining polynomial x^3 - 37
> sage: OK.parent()
> <class 'sage.rings.number_field.order.Order_absolute_with_category'>
> <class 'sage.rings.number_field.order_ideal.NumberFieldOrderIdeal_generic'>
> sage: type(OK)
> <class 'sage.rings.number_field.order.Order_absolute_with_category'>
> sage:
>
> What is the output here:
>
> sage: P.factor??
>
> (here ?? is what we use to print the source code).
>

sage: P.factor??

Source:
def factor(self):
"""
Factorization of this ideal in terms of prime ideals.

EXAMPLES::

sage: x = polygen(ZZ)
sage: K.<a> = NumberField(x^4 + 23); K
Number Field in a with defining polynomial x^4 + 23
sage: I = K.ideal(19); I
Fractional ideal (19)
sage: F = I.factor(); F
(Fractional ideal (19, 1/2*a^2 + a - 17/2))
* (Fractional ideal (19, 1/2*a^2 - a - 17/2))
sage: type(F)
<class 'sage.structure.factorization.Factorization'>
sage: list(F)
[(Fractional ideal (19, 1/2*a^2 + a - 17/2), 1),
(Fractional ideal (19, 1/2*a^2 - a - 17/2), 1)]
sage: F.prod()
Fractional ideal (19)

TESTS:

Number fields defined by non-monic and non-integral
polynomials are supported (:issue:`252`);
the representation depends on the PARI version::

sage: F.<a> = NumberField(2*x^3 + x + 1)
sage: fact = F.factor(2)
sage: (fact[0][1], fact[1][1])
(2, 1)
sage: fact[0][0] == F.ideal(2*a^2 + 1)
True
sage: fact[1][0] == F.ideal(-2*a^2)
True
sage: [p[0].norm() for p in fact]
[2, 2]
"""
try:
return self.__factorization
except AttributeError:
K = self.number_field()
F = K.pari_nf().idealfactor(self.pari_hnf())
A = []
for j in range(0, len(F[0])):
I = K.ideal(F[j,0])
A.append((I,ZZ(F[j,1])))
self.__factorization = Factorization(A)
return self.__factorization
File: /private/var/tmp/sage-10.4-current/local/var/lib/sage/venv-python3.12.4/lib/python3.12/site-packages/sage/rings/number_field/number_field_ideal.py
Type: method
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/CAAWYfq0rh0NNuKNd5HQByqOpXkfvNA8po6fPta4AVv4F%2Bh%2BP5w%40mail.gmail.com.

Justin C. Walker

unread,
Aug 16, 2026, 4:29:05 PM (3 days ago) Aug 16
to SAGE Support
I just installed 10.9 (for development).  Wow!  Smooth and easy!  Thanks for all the work to make this work so well.

On to the problem at hand:

On my installation of 10.9, I get

Sage; P.f[Tab]

age: P.free_

              .free_module    

              .free_resolution


So no “factor” method.  Similar results for “fac[Tab]” and “Fac[Tab]” (the possible choices don’t work with “P”.

And, FWIW:

sage: type(OK)

<class 'sage.rings.number_field.order.Order_absolute_with_category'>

sage: type(P)

<class 'sage.rings.number_field.order_ideal.NumberFieldOrderIdeal_generic'>

sage: OK.parent()

<class 'sage.rings.number_field.order.Order_absolute_with_category'>

sage: P.parent()

Monoid of ideals of Maximal Order generated by [1/3*a^2 + 1/3*a + 1/3, a] in Number Field in a with defining polynomial x^3 - 37


Thanks for your help!

Justin

Dima Pasechnik

unread,
Aug 16, 2026, 5:17:52 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
this code, in sage/rings/number_field/number_field_ideal.py,
is still there, but somehow, I guess due to parenting/typing issues, it doesn't get used.

Dima Pasechnik

unread,
Aug 16, 2026, 5:45:14 PM (3 days ago) Aug 16
to sage-s...@googlegroups.com
I opened

<https://github.com/sagemath/sage/issues/42677>

to deal with this error

Reply all
Reply to author
Forward
0 new messages