I wonder why SageMath cannot compute the intersection of 2 ideals in ZZ.

Is this due to the fact that ZZ would "only" be a PID?

Guillermo

┌────────────────────────────────────────────────────────────────────┐

│ SageMath version 10.1, Release Date: 2023-08-20                    │

│ Using Python 3.11.1. Type "help()" for help.                       │

└────────────────────────────────────────────────────────────────────┘

sage: n1,n2=720,756

sage: d,m=gcd(n1,n2),lcm(n1,n2)

sage: n1,n2,d,m

(720, 756, 36, 15120)

sage: I1,I2=ZZ.ideal(n1),ZZ.ideal(n2)

sage: I1,I2

(Principal ideal (720) of Integer Ring, Principal ideal (756) of Integer
Ring)

sage: I1+I2

Principal ideal (36) of Integer Ring

sage: I1.intersection(I2)

---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

Cell In [7], line 1

----> 1 I1.intersection(I2)


File
/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/structure/element.pyx:488,
in sage.structure.element.Element.__getattr__
(build/cythonized/sage/structure/element.c:4846)()

*    486*         AttributeError:
'LeftZeroSemigroup_with_category.element_class' object has no attribute
'blah_blah'

*    487*     """

--> 488     return self.getattr_from_category(name)

*    489*

*    490* cdef getattr_from_category(self, name):


File
/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/structure/element.pyx:501,
in sage.structure.element.Element.getattr_from_category
(build/cythonized/sage/structure/element.c:4958)()

*    499*     else:

*    500*         cls = P._abstract_element_class

--> 501     return getattr_from_other_class(self, cls, name)

*    502*

*    503* def __dir__(self):


File
/private/var/tmp/sage-10.1-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/cpython/getattr.pyx:362,
in sage.cpython.getattr.getattr_from_other_class
(build/cythonized/sage/cpython/getattr.c:2773)()

*    360*     dummy_error_message.cls = type(self)

*    361*     dummy_error_message.name = name

--> 362     raise AttributeError(dummy_error_message)

*    363* attribute = <object>attr

*    364* # Check for a descriptor (__get__ in Python)


AttributeError: 'Ideal_pid' object has no attribute 'intersection'

sage:

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CANnG18_BEyzLdcmikDNi8j9%3D%2BYHQLVdpMgaTw6UtWkg%3DoJCUAw%40mail.gmail.com.

Reply via email to