Opened 7 months ago

Last modified 5 months ago

#27733 new defect

GL(x, GF(p)).random_element() always same seed (libgap)

Reported by: gh-hellman Owned by:
Priority: minor Milestone:
Component: interfaces Keywords: randomness
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

libgap's randomness is not freshly seeded at the Sage startup. For example, sampling random matrices over GF(p) always produces same results.

$ sage -c 'print GL(4, GF(2)).random_element()'
[0 1 1 1]
[1 1 1 1]
[1 0 1 0]
[1 1 1 0]
$ sage -c 'print GL(4, GF(2)).random_element()'
[0 1 1 1]
[1 1 1 1]
[1 0 1 0]
[1 1 1 0]

Whereas, for example, randint() in Sage is always fresh.

First, this is quite misleading, as it is not even immediately clear that GL uses GAP. Second, it was quite hard to find how to actually reseed that randomness. For example, GAP.set_seed(123) does not help. Instead, libgap.set_seed() does solve the issue.

I guess this relates to the whole libgap's randomness, not only to the GL() groups.

SageMath version 8.7, Release Date: 2019-03-23 │ Using Python 2.7.15.

Change History (2)

comment:1 Changed 5 months ago by embray

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

comment:2 Changed 5 months ago by embray

  • Milestone sage-8.8 deleted

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

Note: See TracTickets for help on using tickets.