Opened 4 years ago

Closed 4 years ago

#27143 closed enhancement (fixed)

Add option to `as_permutation_group` to initialize the seed for pseudo random results via libgap

Reported by: soehms Owned by:
Priority: major Milestone: sage-8.7
Component: group theory Keywords: as_permutation_group, seed
Cc: embray, tscrim Merged in:
Authors: Sebastian Oehms Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 3b3599d (Commits, GitHub, GitLab) Commit: 3b3599d9be44c7994682e3cbab24132dbc702509
Dependencies: Stopgaps:

Status badges

Description

This is a follow up ticket to #26903. The aim is to realize the suggestion given there in comment 9.

Furthermore, as an example the missing doctest of that ticket should be added!

Change History (8)

comment:1 Changed 4 years ago by soehms

Branch: u/soehms/seed_arg_as_permutation_group_27143

comment:2 Changed 4 years ago by soehms

Authors: Sebastian Oehms
Commit: 51cb6fc1b72b39558f51e1f999471d21e3aa1789
Status: newneeds_review

I use the new option to modify existing doctests and add a note citing the GAP documentation. Furthermore, I add the doctest concerning #26903.


New commits:

51cb6fc27143: initial version

comment:3 Changed 4 years ago by tscrim

I would just pass seed to libgap.set_seed or explicitly cast it to an int or Integer (whichever is more appropriate and let the error fall out from that. IMO, the traceback would provide sufficient information and this would allow things that to convert to ZZ to work (well, at least in the latter case).

comment:4 Changed 4 years ago by git

Commit: 51cb6fc1b72b39558f51e1f999471d21e3aa17893b3599d9be44c7994682e3cbab24132dbc702509

Branch pushed to git repo; I updated commit sha1. New commits:

3b3599d27143: following the reviewers suggestion

comment:5 Changed 4 years ago by soehms

The reason, why I didn't just pass it, is:

gap> Reset(GlobalRandomSource, "something");
[ 45, [ 66318732, 86395905, 22233618, 21989103, 237245480, 264566285, 240037038, 264902875, 9274660, 180361945, 94688010, 24032135, 106293216, 27264613, 126456102, 243761907, 80312412, 2522186,
      59575208, 70682510, 228947516, 173992210, 175178224, 250788150, 73030390, 210575942, 128491926, 194508966, 201311350, 63569414, 185485910, 62786150, 213986102, 88913350, 94904086,
      252860454, 247700982, 233113990, 75685846, 196780518, 74570934, 7958751, 130274620, 247708693, 183364378, 82600777, 28385464, 184547675, 20423483, 75041763, 235736203, 54265107, 49075195,
      100648387, 114539755 ] ]
gap> State(GlobalRandomSource);
"so"
gap>

I have no idea, what this should mean (this use of the argument is not described in the GAP-documentation).

But I agree to your suggestion to cast the argument!

comment:6 Changed 4 years ago by tscrim

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

Thank you.

comment:7 Changed 4 years ago by soehms

Thanks, as well!

comment:8 Changed 4 years ago by vbraun

Branch: u/soehms/seed_arg_as_permutation_group_271433b3599d9be44c7994682e3cbab24132dbc702509
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.