Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QQbar should have a coercion from number fields with embedding #5355

Open
sagetrac-cwitty mannequin opened this issue Feb 24, 2009 · 7 comments
Open

QQbar should have a coercion from number fields with embedding #5355

sagetrac-cwitty mannequin opened this issue Feb 24, 2009 · 7 comments

Comments

@sagetrac-cwitty
Copy link
Mannequin

sagetrac-cwitty mannequin commented Feb 24, 2009

If a number field comes with an embedding into the complex numbers, QQbar should allow coercions (or at least conversions) from that number field.
For example:

sage: K.<a> = NumberField(x^3 - x + 1, embedding=-1.32)
sage: QQbar.coerce_map_from(K)
Ring morphism:
  From: Number Field in a with defining polynomial x^3 - x + 1
  To:   Algebraic Field
  Defn: a |--> -1.324717957244746?

Currently, this map can already be created using K.hom([QQbar(a)]) (see #13041).

Component: coercion

Keywords: qqbar

Issue created by migration from https://trac.sagemath.org/ticket/5355

@sagetrac-cwitty sagetrac-cwitty mannequin self-assigned this Feb 24, 2009
@JohnCremona
Copy link
Member

comment:1

This should not be hard. Here is what I propose:

  • Given a number field K and an emebedding of K into RR or CC, return the corresponding embedding of K into QQbar. This just requires selecting from K.embeddings(QQbar) the one which maps K.gen() to the element of QQbar closest to the image of K.gen() under the given embedding. As a variation, if the given embedding was into RR then the output could be an embedding into AA>

  • As a default we could give no embedding and then use K.gen().complex_embedding() instead.

Using the default there would be a coercion possible from K to QQbar; but the first version would allow the user flexibility.

@mezzarobba
Copy link
Member

comment:2

Related: #12715

@videlec
Copy link
Contributor

videlec commented Mar 11, 2016

comment:3

We do have

sage: K.<a> = NumberField(x^3 - 7, embedding=AA(7)**(1/3))
sage: AA.has_coerce_map_from(K)
True
sage: K.<a> = NumberField(x^3 - 7, embedding=QQbar(7)**(1/3) * QQbar.zeta(3))
sage: QQbar.has_coerce_map_from(K)
True

Isn't it enough? What should be simplified is to automatized the embedding into AA/QQbar. And it is more or less the purpose of #19356.

@pjbruin

This comment has been minimized.

@jplab
Copy link

jplab commented Apr 22, 2019

Changed keywords from none to qqbar

@nbruin
Copy link
Contributor

nbruin commented Apr 22, 2019

comment:6

There are memory-leak implications on this: Coercions are normally cached on the codomain (in this case QQbar). Having a coercion from a number field K to QQbar would imply a reference from QQbar to K. Some effort is made to not make that reference a strong one right from the start (this is why the coercion framework tries to use weak references to the domain), but you'd have to test this quite carefully. Thanks to the complicated interactions with the (weak) dictionaries, I expect that some indirect memory leaks would be introduced.

@mkoeppe
Copy link
Member

mkoeppe commented Apr 22, 2019

comment:7

Replying to @videlec:

We do have

sage: K.<a> = NumberField(x^3 - 7, embedding=AA(7)**(1/3))
sage: AA.has_coerce_map_from(K)
True
sage: K.<a> = NumberField(x^3 - 7, embedding=QQbar(7)**(1/3) * QQbar.zeta(3))
sage: QQbar.has_coerce_map_from(K)
True

Isn't it enough? What should be simplified is to automatized the embedding into AA/QQbar. And it is more or less the purpose of #19356.

To automate the embedding, what should be the interface, perhaps something like this?

K.<a> = NumberField(x^3 - 7, embedding=1.9, embedding_field=AA)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants