On Thursday, February 7, 2019 at 10:11:06 AM UTC-8, Brent W. Baccala wrote: > > > Q1: Shouldn't `number_field_elements_from_algebraics` return a NumberField > with an embedding attached? >
Doesn't https://trac.sagemath.org/ticket/23808 address this? [answering my own question: no it doesn't! There they just redefine the number field in a way similar to what you do. Yes, I think it would be quite reasonable to install an embedding.] > Q2: Any better way to add an embedding to an existing NumberField? > Problem is: number fields are elements with UniqueRepresentation, so if someone else constructs a number field with the same construction parameters (in the same session), they'll get a pointer to THE SAME object in memory. Hence, you cannot go scribbling new embedding info on the object. The embedding needs to be part of the construction parameters. Q3: Once I've created `nf2`, is there any way to tell that it's got an > embedding attached? > See if the return value of nf2.coerce_embedding() is not None. > Q4: Shouldn't `nf2`'s print representation include its embedding? > I'd be concerned it might clutter things too much. It's just a fact of life that the print representation doesn't allow you to conclude the identity of an object. The embedding is part of the coercion data on the object, and generally we do not provide info on the coercion graph in the print representation. While coercion is nice, it's almost always not necessary: from <number field>.embeddings you can get all the complex and real embeddings you want as nice homomorphisms. We're never going to cover everything with coercion (because you'll quickly end up with inconsistent coercion graphs), so we should keep ensuring we have good support for using explicit homomorphisms whenever one is required. -- 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 post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.