Attribute Error gcd
Hello, I am running a program which is doing many computations of gcd of elements of Z[i] (Gaussian integers). It's doing computations of the kind (for many different c and d's):
K.<i> = QuadraticField(-1)
O = K.maximal_order()
u=O(c).gcd(O(d))
where c and d are some non-zero elements of Z[i].
The program strangely breaks a bit randomely (in particular, when I launch it twice it does not break at the same point, i.e. it breaks with different c and d's).
I get an attribute error of the type:
AttributeError Traceback (most recent call last)
~/.conda/envs/sage/lib/python3.10/site-packages/sage/rings/number_field/number_field_ideal.py in is_integral(self)
961 try:
--> 962 return self.__is_integral
963 except AttributeError:
~/.conda/envs/sage/lib/python3.10/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4826)()
493 """
--> 494 return self.getattr_from_category(name)
495
~/.conda/envs/sage/lib/python3.10/site-packages/sage/structure/element.pyx in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4938)()
506 cls = P._abstract_element_class
--> 507 return getattr_from_other_class(self, cls, name)
508
~/.conda/envs/sage/lib/python3.10/site-packages/sage/cpython/getattr.pyx in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2702)()
360 dummy_error_message.name = name
--> 361 raise AttributeError(dummy_error_message)
362 attribute = <object>attr
AttributeError: 'NumberFieldFractionalIdeal' object has no attribute '_NumberFieldIdeal__pari_hnf'
Even more weird, when I try to compute separetely the gcd with the same c and d's that lead to this error, there is no problem. It does not make sense to me. My server has SageMath version 9.5, Release Date: 2022-01-30 Using Python 3.10.5.
Thanks for your help!
Do you have an example code that reproduces this issue?
Not really. It is part of a large code of mine. But even if I launch it twice on the machine with the same parameters, I will get an error at a different stage of the program...
You should try to write a simple code that reproduces the error, otherwise we can not help.