First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There is a (not so well advertized) function for that purpose

sage: from sage.rings.qqbar import number_field_elements_from_algebraics
sage: K, (a, b, c), phi = number_field_elements_from_algebraics([sqrt(3), sqrt(2), 2])

The output is - K: a number field containing your elements -(a, b, c): your elements as elements of K - phi: a morphism from K to QQbar

click to hide/show revision 2
No.2 Revision

There is a (not so well advertized) function for that purpose

sage: from sage.rings.qqbar import number_field_elements_from_algebraics
sage: K, (a, b, c), phi = number_field_elements_from_algebraics([sqrt(3), sqrt(2), 2])

The output is - is

  • K: a number field containing your elements -(a, b, c): your elements as elements of K
  • -
  • phi: a morphism from K to QQbar

click to hide/show revision 3
No.3 Revision

There is a (not so well advertized) function for that purpose

sage: from sage.rings.qqbar import number_field_elements_from_algebraics
sage: K, (a, b, c), phi = number_field_elements_from_algebraics([sqrt(3), sqrt(2), 2])

The output is

  • K: a number field containing your elements -elements
  • (a, b, c): your elements as elements of K
  • phi: a morphism from K to QQbar