Opened 10 years ago

Last modified 10 years ago

#11725 closed enhancement

Generate random elements of the algebraic field — at Initial Version

Reported by: rbeezer Owned by: AlexGhitza
Priority: minor Milestone: sage-4.7.2
Component: algebra Keywords: random, QQbar, sd32
Cc: spice Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Random elements of QQbar default to the method implemented for the integers. This patch creates algebraic numbers via roots of random polynomials with integer coefficients.

Implementation notes:

  1. Degree 2 is the default so that some complex numbers are generated.
  2. Might create constant polynomials, so a monic term (of random degree) may be added.
  3. Could be some efficiencies to be gained by not creating all the roots and choosing just one, but this should be a good start.
  4. Real goal was random vectors over QQbar. A doctest demonstrates how control of the integer coefficients can be passed from random_vector() to the QQbar.random_element() to `ZZ.random_element().

Change History (1)

Changed 10 years ago by rbeezer

Note: See TracTickets for help on using tickets.