┌────────────────────────────────────────────────────────────────────┐
│ 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:
Thanks, Nils.My question was motivated by using SageMath in my teachings.Do you think it would be difficult/worthwhile taking care of this?I mean, ideals in euclidean rings (or at least in ZZ).
If I understand you correctly, SageMath is a bit loose at the moment about its categories.