ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 02 Oct 2018 14:39:50 +0200Error: 'Object has no attribute 'intersection''https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/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.
Mon, 01 Oct 2018 08:51:51 +0200https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/Comment by eric_g for <p>Hi, I am pretty new to SAGE and and am not understanding why my code keeps giving me the error <strong>'RelativeOrder_with_category' object has no attribute 'intersection'</strong>. Here is my code:</p>
<pre><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'
</code></pre>
<p>I have looked at a lot of examples from other questions, but I can't seem to find a solution. </p>
https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/?comment=43812#post-id-43812I 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?Tue, 02 Oct 2018 11:52:40 +0200https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/?comment=43812#post-id-43812Comment by Iguananaut for <p>Hi, I am pretty new to SAGE and and am not understanding why my code keeps giving me the error <strong>'RelativeOrder_with_category' object has no attribute 'intersection'</strong>. Here is my code:</p>
<pre><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'
</code></pre>
<p>I have looked at a lot of examples from other questions, but I can't seem to find a solution. </p>
https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/?comment=43814#post-id-43814AFAICT 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)`.Tue, 02 Oct 2018 14:39:50 +0200https://ask.sagemath.org/question/43799/error-object-has-no-attribute-intersection/?comment=43814#post-id-43814