Number Field questions

35 views
Skip to first unread message

Justin C. Walker

unread,
Jun 11, 2025, 4:31:09 PMJun 11
to SAGE Support
Hi, all,

I am stuck in a twisty maze of passages within the number field code. Here’s an example:

f=x^4+2
K.<a>=NumberField(f)
OK = K.maximal_order()
a = OK.gen()
O = ZZ[a]
O.index_in(OK)

!Boom: not matching ambients!

It seems as if this should work, at least if I could figure out how to patch things together.

Is coercion the answer? How do I do that, if so.

Thanks for any help.

Justin


chris wuthrich

unread,
Jun 12, 2025, 3:47:12 AMJun 12
to sage-support
Hi Justin

I never used ZZ[a], I would use K.order(a). As in

sage: K.<a> = NumberField(x^4+2)
sage: OK = K.maximal_order()
sage: O = K.order(3*a)
sage: O.index_in(OK)
729

Chris

Justin C. Walker

unread,
Jun 12, 2025, 2:34:53 PMJun 12
to SAGE Support
Hi, Chris,

Thank you for that.  I know about the .order method, but for reasons long past, I often use ZZ[a], and I was puzzled that Sage knows that the latter is an order in the number field (hence, one would think, contained in OK), but I could see no way to persuade the program to admit that.

I’ll keep poking, but in the meantime, I can going back to making fitful progress.

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/517419b0-15ea-42c2-af7c-cfda3ec06964n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages