#11850: random element of ideal
-----------------------------------+----------------------------------------
Reporter: dangtuanhiep | Owner: malb
Type: enhancement | Status: needs_work
Priority: trivial | Milestone: sage-4.7.2
Component: commutative algebra | Keywords: random, ideal, sd34
Work_issues: | Upstream: N/A
Reviewer: | Author: Hiep Dang
Merged: | Dependencies:
-----------------------------------+----------------------------------------
Changes (by malb):
* status: needs_review => needs_work
Comment:
I don't think this code
{{{
#!python
sum(g * self.ring().random_element(degree - g.degree(), *args, **kwds) for
g in self.gens())
}}}
returns a uniformly random element up to the given degree.
* one should at least use the Gröbner basis instead of gens()
* even then I don't think this code returns uniformly random elements up
to some degree, because of potential cancellations.
I suggest to do:
{{{
#!python
f = P.random_element()
f = f - f.reduce(self)
}}}
which is "as random" as {{{P.random_element()}}} because {{{P = I \oplus
P/I}}}.
In case you are wondering: sampling uniform from an ideal given a set of
generators is as hard as computing the GB (at least for dense/zero-
dimensional systems):
http://eprint.iacr.org/2011/289
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11850#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.