One additional problem with the order is that it is not numerically stable.

An example where it is currently used in sage is
NumberField.embeddings()-function, the roots of the defining
polynomial are sorted this way. Due to the possible numerical
instability, it is not clear that the order of the returned embeddings
will not change with different precisions.

Le mer. 20 mai 2020 à 19:27, Nils Bruin <nbr...@sfu.ca> a écrit :
>
> On Wednesday, May 20, 2020 at 3:42:57 PM UTC-7, mathzeta2 wrote:
>>
>> This seems to be the case:
>> https://git.sagemath.org/sage.git/tree/src/sage/rings/complex_number.pyx#n1176
>> https://git.sagemath.org/sage.git/tree/src/sage/rings/complex_double.pyx#n807
>>
>> The latter even says: "We order the complex numbers in dictionary order
>> by real parts then imaginary parts.
>>
> This is a painful legacy from python's early approach of "everything should 
> be ordered", that sage at that time sort-of adopted. With complex numbers, 
> python (even py2) quickly came to its senses and in Python3, objects are 
> usually not ordered unless it intrinsically makes sense. Sage is now still 
> stuck with the flawed design of the past. It would be nice to deprecate that 
> behaviour now that we're released from python2.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/24d36ef4-5fa7-49cd-8188-3f6bb8c95d36%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CA%2B%2BQ1_AE%3Dqqah5JrYJwFU%3D-PR5VR43Wqcc%3DJbW1imHsbySDKYg%40mail.gmail.com.

Reply via email to