Error: 'Object has no attribute 'intersection''

asked 2018-10-01 08:51:51 +0100

northcity4 gravatar image

Hi, I am pretty new to SAGE and and am not understanding why my code keeps giving me the error 'RelativeOrder_with_category' object has no attribute 'intersection'. Here is my code:

sage: P1=x^3-x^2-4*x-1
sage: P2=x^3+x^2-2*x-1
sage: K1.<p>=NumberField(P1)
sage: K2.<d>=NumberField(P2)
sage: K.<p,d>=ExtensionField(K1,P2)
sage: O_K=K.ring_of_integers()
sage: A_K1=O_K.intersection(K1)
AttributeError: 'RelativeOrder_with_category' object has no attribute 'intersection'

I have looked at a lot of examples from other questions, but I can't seem to find a solution.

edit retag flag offensive close merge delete

Comments

I cannot reproduce your issue with SageMath 8.3 since the step K.<p,d>=ExtensionField(K1,P2) leads to

NameError: name 'ExtensionField' is not defined

Which version of SageMath are you using?

eric_g gravatar imageeric_g ( 2018-10-02 11:52:40 +0100 )edit

AFAICT there is no class or factory in any version of Sage called just ExtensionField, so it's either user-defined, or a rename of something else built into Sage. It would help to know exactly what that is. That said, it seems you have there a RelativeOrder which, according to the docs, is the class used for orders in "some relative number field". I don't know what is meant by "relative" in terms of number fields but I'm not an algebra expert. But it seems that RelativeOrder does not have an intersection() method (perhaps it doesn't make sense for it to). However, RelativeOrder does appear to have an "absolute" order which it is defined relative to. So maybe what you want is O_K.absolute_order().intersection(K1).

Iguananaut gravatar imageIguananaut ( 2018-10-02 14:39:50 +0100 )edit